[Patch] Moneypunt cache: do_get bits
Paolo Carlini
pcarlini@suse.de
Sat Feb 21 16:07:00 GMT 2004
Hi,
the below continues the project, with the straightforward do_get
bits. For this (P4-2400, -O2):
locale loc_hk = locale("en_HK");
...
for (int i = 0; i < 1000000; ++i)
{
iss.str("(HKD 100,000,000,000.00)");
iterator_type is_it10(iss);
string result10;
ios_base::iostate err10 = ios_base::goodbit;
mon_get.get(is_it10, end, true, iss, err10, result10);
}
current mainline
----------------
10.140u 0.000s 0:10.45 97.0% 0+0k 0+0io 256pf+0w
current + cache
---------------
7.640u 0.000s 0:07.86 97.2% 0+0k 0+0io 254pf+0w
In this case too a string::reserve helps reducing the reallocations:
current + cache + reserve
-------------------------
4.740u 0.010s 0:04.89 97.1% 0+0k 0+0io 254pf+0w
Took the occasion to fix a bug in the parsing of the sign component:
according to 22.2.6.1.2, p3, "If pos or neg is empty, the sign
component is optional, and if no sign is detected, the result is
given the sign that corresponds to the source of the empty string"
(see also the testcase)
Tested x86-linux, both gnu/generic. Will commit tomorrow, barring
comments. Next in queue: money_put::do_put speed-up; avoid narrow in
do_get.
Paolo.
//////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_mon_cache_get
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040221/3c44a067/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_mon_cache_get
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040221/3c44a067/attachment-0001.ksh>
More information about the Libstdc++
mailing list