This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: iconv changes


Ulrich Drepper <drepper@cygnus.com> writes:

|> I haven't seen any regressions but please give it a try yourself.  And
|> if somebody can come up with some timing results (before, after) I'd
|> appreciate seeing them.

Ok, here are some facts.

The reading of the gconv configuration still takes some significant part
of the startup time, but it is much better than before.  For comparision i
have prepared a profiled binary of df, and here are the top functions
before and after the rewrite, using the command line
	$ LC_CTYPE=de_DE df .

before:
----------------------------------------------------------------------
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 50.60      5.44     5.44                             mcount
 10.79      6.60     1.16   140948     0.01     0.01  detect_conflict
 10.74      7.75     1.16    83553     0.01     0.01  strcasecmp
  9.02      8.72     0.97      496     1.96     5.48  trecurse
  6.19      9.39     0.67    77443     0.01     0.01  strcmp
  2.23      9.63     0.24        2   120.00   808.91  find_derivation
  1.86      9.83     0.20      161     1.24     1.25  re_match_2_internal
  0.74      9.91     0.08      823     0.10     0.38  tsearch
  0.65      9.98     0.07     1908     0.04     0.07  malloc
  0.60     10.04     0.07     1230     0.05     0.05  index
  0.56     10.11     0.06     7802     0.01     0.01  maybe_split_for_insert
  0.56     10.16     0.06     1914     0.03     0.03  chunk_alloc
  0.56     10.22     0.06        3    20.00    40.73  _dl_relocate_object
  0.51     10.28     0.06       40     1.38     1.38  stpcpy
  0.47     10.33     0.05      632     0.08     0.21  tfind
  0.47     10.38     0.05      238     0.21     0.24  _dl_lookup_versioned_symbol
  0.37     10.42     0.04        1    40.00  3325.80  read_conf_file
  0.28     10.45     0.03     2622     0.01     0.01  memcpy
  0.28     10.48     0.03     1198     0.03     0.03  memchr
  0.28     10.51     0.03     1123     0.03     0.07  getdelim
----------------------------------------------------------------------
after:
----------------------------------------------------------------------
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 40.17      0.94     0.94                             mcount
 15.17      1.29     0.35    26360     0.01     0.01  strcmp
  6.41      1.45     0.15        1   150.00  1092.17  read_conf_file
  3.63      1.53     0.09     6853     0.01     0.01  strncmp
  2.99      1.60     0.07     7432     0.01     0.01  strcasecmp
  2.56      1.66     0.06     1434     0.04     0.04  chunk_alloc
  2.56      1.72     0.06      238     0.25     0.30  _dl_lookup_versioned_symbol
  2.14      1.77     0.05      507     0.10     0.19  detect_conflict
  1.92      1.81     0.04     1230     0.04     0.04  index
  1.71      1.85     0.04     4900     0.01     0.01  maybe_split_for_insert
  1.71      1.90     0.04     1198     0.03     0.03  memchr
  1.71      1.94     0.04     1118     0.04     0.08  malloc
  1.71      1.98     0.04     1111     0.04     0.04  bcmp
  1.71      2.02     0.04        3    13.33    36.75  _dl_relocate_object
  1.50      2.05     0.04      513     0.07     0.34  tsearch
  1.28      2.08     0.03     6910     0.00     0.01  __gconv_alias_compare
  1.28      2.11     0.03     1123     0.03     0.08  getdelim
  1.28      2.14     0.03      316     0.09     0.14  calloc
  0.85      2.16     0.02     2462     0.01     0.01  memcpy
  0.85      2.18     0.02      332     0.06     0.06  __strtol_internal
----------------------------------------------------------------------

As you can see, the total runtime of read_conf_file has been cut down to
a third.  The detailed analysis also shows that it has improved
considerably.

before:
-----------------------------------------------
index % time    self  children    called     name
                0.04    3.29       1/1           __gconv_read_conf [13]
[14]    62.6    0.04    3.29       1         read_conf_file [14]
                0.00    2.62     489/508         twalk [15]
                0.08    0.23     799/823         tsearch [21]
                0.05    0.08     620/632         tfind [36]
                0.03    0.05    1123/1123        getdelim [45]
                0.06    0.00    1122/1230        index [47]
                0.03    0.03     799/1908        malloc [37]
                0.01    0.00    1109/2622        memcpy [53]
                0.01    0.00    1110/1111        bcmp [77]
                0.01    0.00     310/332         __strtol_internal [81]
                0.00    0.00       1/4           fclose [73]
                0.00    0.00       1/4           fopen [90]
                0.00    0.00       1/486         cfree [59]
                0.00    0.00     620/849         mempcpy [145]
-----------------------------------------------
after:
-----------------------------------------------
index % time    self  children    called     name
                0.15    0.94       1/1           __gconv_read_conf [13]
[14]    78.0    0.15    0.94       1         read_conf_file [14]
                0.32    0.00   23870/26360       strcmp [15]
                0.03    0.13     489/513         tsearch [16]
                0.05    0.05     489/507         detect_conflict [23]
                0.03    0.06    1123/1123        getdelim [26]
                0.03    0.01     310/316         calloc [42]
                0.01    0.03     310/329         tfind [41]
                0.04    0.00    1122/1230        index [40]
                0.04    0.00    1110/1111        bcmp [47]
                0.02    0.02     489/1118        malloc [27]
                0.04    0.00    2899/6853        strncmp [28]
                0.02    0.00     310/332         __strtol_internal [55]
                0.01    0.00    1109/2462        memcpy [51]
                0.00    0.00       1/4           fclose [63]
                0.00    0.00       1/4           fopen [83]
                0.00    0.00     620/689         mempcpy [143]
                0.00    0.00       1/13          cfree [150]
-----------------------------------------------

Andreas.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]