[Patch] Nathan's improvements to basic_string
Paolo Carlini
pcarlini@unitus.it
Thu Jun 12 18:59:00 GMT 2003
Hi,
below you will find attached the long standing patch
contributed by Nathan, rediffed against mainline, which
finally I and Loren got around to test for performance
(besides the obvious regression testing).
Indeed, the improvements are easily measurable even on
single processor machines, like my P4-2400/linux.
Consider this testcase:
#include <string>
main()
{
for (int i = 0; i < 1000; ++i) {
std::string a[100000];
}
}
Current mainline:
-O0: 11.900u 0.000s 0:11.98 99.3% 0+0k 0+0io 204pf+0w
-O2: 10.420u 0.010s 0:10.51 99.2% 0+0k 0+0io 204pf+0w
Current + Nathan's:
-O0: 3.310u 0.000s 0:03.32 99.6% 0+0k 0+0io 201pf+0w
-O2: 0.350u 0.000s 0:00.35 100.0% 0+0k 0+0io 201pf+0w
As you can see, besides a great improvement at -O0, it
becomse also easier for the compiler to optimize away
dead instances (I would appreciate some feedback from
Nathan's about this additional nice feature)
Everything considered we believe with Loren (more expert
than me of MT topics) that the patch should go in as soon
as possible, but nevertheless will wait some additional
24 hours, just in case...
Thanks,
Paolo.
////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_nathan
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030612/b3eceb06/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_nathan
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030612/b3eceb06/attachment-0001.ksh>
More information about the Libstdc++
mailing list