From: Christophe de V. <cde...@al...> - 2003-09-30 19:33:42
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Mardi 30 Septembre 2003 19:58, Jonathan Wakely a =E9crit : > On Sun, Sep 28, 2003 at 11:33:55PM +0200, Christophe de Vienne wrote: > > I've made small tests with write_to_stream and write_to_string. > > It appeared that using write_to_stream is _much_ slower than > > write_to_string then sending the result to the stream, even if using a > > ostringstream instead of std::cout. > > This *might* be because write_to_string followed by one call to > operator<<(ostream,string) can use the length of the string and perform > a single write, whereas write_to_stream will perform several writes to > the output location (whether it's a stringstream's buffer or stdout). I was thinking of something like this. Do you know if there is any way to change how a ostream buffer or not the=20 datas before sending them ? > > Which compiler version did you test this with? > There's been a *lot* of work on improving iostream performance in GCC > recently, some of this won't land until GCC 3.4, but the 3.3.x branch > has some improvements too. gcc 3.3.x (I don't have the minor, but I think it's the last one). Thanks, Christophe =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/edqOB+sU3TyOQjARAqBUAJ9iDcLbf2WeTcSKCbwmQH8f/CeuZQCgsU9X 8KXqS+SWVjZPb/4/qg515vg=3D =3DM79e =2D----END PGP SIGNATURE----- |