This is the mail archive of the
mailing list for the libstdc++ project.
Re: [Fwd: basic_string<> - useless because of its poor performance
- To: ncm at cantrip dot org
- Subject: Re: [Fwd: basic_string<> - useless because of its poor performance
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Mon, 9 Jul 2001 16:55:48 -0500 (CDT)
- Cc: libstdc++ at gcc dot gnu dot org
>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...