Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-823

[HP-UX] poor performance of setlocale() with +DD64

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • External
    • None
    • HP-UX

    • Inefficiency

    Description

      The following test case shows a a precipitous dropoff in the performance in setlocale() on HP-UX (regardless of the hardware architecture, i.e., on both IPF and PA-RISC) between +DD32 and DD64:

      On HP-UX 11.31/IPF:

      $ cat t.c && aCC t.c && time ./a.out 1000 && aCC +DD64 t.c && time ./a.ou>
      #include <stdlib.h>
      #include <locale.h>
      
      const char* const locales[] = {
          "C",
          "C.iso88591",
          "C.iso885915",
          "C.utf8",
          "univ.utf8",
          "ar_DZ.arabic8",
          "ar_DZ.utf8",
          "ar_SA.arabic8",
          "ar_SA.iso88596",
          "zh_CN.hp15CN",
          "zh_CN.utf8"
      };
      
      void test () {
          unsigned i;
          for (i = 0; i != sizeof locales / sizeof *locales; ++i)
              setlocale (LC_ALL, locales [i]);
      }
      
      int main (int argc, char *argv[])
      {
          unsigned nloops;
          nloops = 1 < argc ? strtoul (argv [1], 0, 0) : 10000;
      
          while (nloops--)
              test ();
      }
      
      real    0m0.466s
      user    0m0.180s
      sys     0m0.280s
      
      real    0m3.620s
      user    0m1.560s
      sys     0m2.040s
      

      On HP-UX 11.23/PA:

      real    0m1.060s
      user    0m0.290s
      sys     0m0.510s
      
      real    0m28.550s
      user    0m16.110s
      sys     0m11.850s
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebor Martin Sebor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: