Re: [libxml++] write_to_stream speed



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Mardi 30 Septembre 2003 19:58, Jonathan Wakely a écrit :
> 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 
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/edqOB+sU3TyOQjARAqBUAJ9iDcLbf2WeTcSKCbwmQH8f/CeuZQCgsU9X
8KXqS+SWVjZPb/4/qg515vg=
=M79e
-----END PGP SIGNATURE-----





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]