[Patch] Part3: speed-up getline(string)

Paolo Carlini pcarlini@suse.de
Tue Nov 16 18:14:00 GMT 2004


Hi,

this is the next step (probably the last, for a while): by declaring
getline(string) friend of basic_streambuf (as envisaged by Matt), we
can use for it too the protected members, and implement the very same
strategy already in place for getline(char_type*). The performance
improve noticeably and for the testcase in libstdc++/15002 there is
no difference anymore between the 3 cases:

27_io/ifstream_getline-2.cc

current
=======
C (fgets)         58r   40u   18s
C++ (string)     203r  184u   15s <<<<
C++ (char array)  54r   36u   17s

patched
=======
C (fgets)         59r   39u   20s
C++ (string)      58r   36u   22s <<<<
C++ (char array)  54r   41u   13s

Regtested x86-linux, will test more on x86_64 too, and barring
objections, will commit soon...

Paolo.

P.S. As soon as I can return to these issues, would like to work on
commonizing code.

///////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_getline_string
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20041116/5ceb53d6/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_getline_string
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20041116/5ceb53d6/attachment-0001.ksh>


More information about the Libstdc++ mailing list