[Prelim patch] Speed up ints parsing

Paolo Carlini pcarlini@suse.de
Fri Dec 5 22:56:00 GMT 2003


Hi,

you find attached to this message what I have ready, in case
someone wants to play with it: I plan to refine it and post
a final version during the weekend or at most on monday.

The testsuite is ok, some more tests are ok, and the performance
are pretty good. Reading back a file containing 3000000 ints
(from 0 to 2999999) via:

  int j;
  for (int i = 0; i < 3000000; i++)
    std::cin >> j;

takes, on my P4-2400 (-O2):

3.4
---
18.740u 0.030s 0:19.59 95.8%    0+0k 0+0io 208pf+0w

3.4 + this patch
----------------
9.940u 0.030s 0:10.40 95.8%     0+0k 0+0io 197pf+0w


So, almost a 2x speed gain (besides the major code clean up!)


Ciao for now,
Paolo.

/////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_integer_get
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031205/1867d3cc/attachment.ksh>


More information about the Libstdc++ mailing list