[Patch] Add _M_true(false)name_len to _numpunct_cache

Paolo Carlini pcarlini@suse.de
Sun Jan 11 21:06:00 GMT 2004


Hi,

since we have a cache, why computing string lengths again and again?
Besides, this also allows for a nice clean up of _M_cache.

As for the numbers, well, we are already pretty fast at get (recently
reworked ;) and put of booleans, but anyway, on my P4-2400, -O2, for

iss.setf(ios_base::boolalpha);
for (int i = 0; i < 10000000; ++i)
  {
    iss.str("true ");
    ng.get(iss.rdbuf(), 0, iss, err, b0);
  }

we get:

3.4
---
5.650u 0.000s 0:05.66 99.8%     0+0k 0+0io 189pf+0w

3.4 + patch
-----------
5.100u 0.010s 0:05.12 99.8%     0+0k 0+0io 189pf+0w

3.3.2
-----
12.920u 0.000s 0:12.96 99.6%    0+0k 0+0io 202pf+0w

icc8
----
7.500u 0.000s 0:07.51 99.8%     0+0k 0+0io 201pf+0w


Tested x86-linux, bot gnu/generic, will commit tomorrow barring
objections...

Paolo.

///////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_truefalse
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040111/a04a9a43/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_truefalse
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040111/a04a9a43/attachment-0001.ksh>


More information about the Libstdc++ mailing list