This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tackling library IO performance


Jerry Quinn wrote:

Next, I tried to bypass the call to grouping() in
num_put<char>::_M_widen_int.  It turns out that the virtual call to
numpunct<char>::grouping() is expensive.  Bypassing this call brings
the runtime from 22s down to 11s!

After some digging in the archives, I found that Nathan Myers
originally added a mechanism to deal with this by caching some of the
formatting strings, paying for the virtual calls once per locale.
However, the format cache was removed in
http://gcc.gnu.org/ml/libstdc++/2001-11/msg00279.html.  But I couldn't
find a reason for the removal of the cache.  My suspicion is that it
is tied to threading issues, but I don't know.

I added the old format cache back in to my test program and got about
the same runtime improvement.

Hi Jerry. I like in particular this part of your work, which is generic
(not tied to a particular type) and promise to bring a substantive
improvement.

Thanks in advance for your contributions!

Paolo.


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