[Fwd: basic_string<> - useless because of its poor performance

Loren James Rittle rittle@latour.rsch.comm.mot.com
Mon Jul 9 14:55:00 GMT 2001


>The "amortized linear" requirement means that adding <N> characters 
><M> times should take o(NM) time.  (<X> is a random variable with
>expectation X.)  With a linear allocation strategy, allocation time
>dominates the runtime, and you get much slower performance than NM, 
>as measured.  With an exponential allocation strategy, allocation time
>drops out and the copying time dominates, as required.

OK, fully understood now.  I was making the mistake that malloc()
dominated O() not the copying...



More information about the Libstdc++ mailing list