You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2006/08/12 00:31:58 UTC

Re: ostringstream performance

Ravi Inampudi wrote:
> Hello,
> 
> I have a customer using the ostringstream who is running the following test case which is taking more than twice the amount between SourcePro ed 4 and ed 7. I also tried with ed 9 and found the performance a little better than ed 7 but still slower. Using quantify, the possible source of the slowdown seem to happen in include/streambuf.cc, xsputn()'s for loop .  Any known issues?  Timing results are shown below.

It could be this issue:
http://issues.apache.org/jira/browse/STDCXX-149

Note that the inefficient behavior was mandated by the C++ standard
(and effectively still is, until the new standard is issued). The
development version of stdcxx implements the accepted resolution
and runs quite a bit faster (all there compiled at -O):

   # stdcxx 4.2 (unreleased)
   real    0m1.516s
   user    0m1.494s
   sys     0m0.018s

   # Sun C++ 5.8
   real    0m3.256s
   user    0m3.024s
   sys     0m0.033s

   # Sun C++ 5.8 with -library=stdlport4
   real    0m2.065s
   user    0m1.915s
   sys     0m0.024s

Martin