Package: libstdc++2.10-dev
Version: 2.95.3-9

The CPU time taken by stringstream is quadratic in the length
of the string buffer.  This makes stringstream unusable for
large (but not unreasonably large) contents.

The problem is this line in std::stringbuf::overflow:

              stream_len += 1;

which increases the size of the buffer by 1 character at a time.
Changing it to something like

       stream_len += stream_len + 1;

fixes the problem.

Ralph.




Reply via email to