On Mon, 28 Jun 2004 15:48:56 +0200, Steffen Conrad
<st************@gmx.de> wrote:
Hi,
I want to buffer a large amount of ASCII-output (some 100 MB).
Therefore I'm asking myself, if when using a stringstream for this would
cause a mentionable loss of performance against a dynamically allocated
char-buffer.
Depending on the implementation, stringstream might use up to twice
the memory buffered (e.g. 200MB in your case). I'd suggest using your
own code in this case. You could write your own streambuf that handles
the memory allocation in the way that you want, or you could use
CStdio style code or your own custom code instead.
You should probably profile the stringstream approach first though, to
see whether performance is already acceptable.
Tom
--
C++ FAQ:
http://www.parashift.com/c++-faq-lite/
C FAQ:
http://www.eskimo.com/~scs/C-faq/top.html