Is all this Invarient **** er... stuff, premature optimisation?

Lars Ivar Igesund larsivar at igesund.net
Mon Apr 28 11:55:56 PDT 2008


Sean Kelly wrote:

> == Quote from Walter Bright (newshound1 at digitalmars.com)'s article
>> Janice Caron wrote:
>> > If there's enough interest, and if Walter approves, I could certainly
>> > kickstart std.stringbuffer. Is that the right way to go? What do
>> > people think?
>> What it will do is provide a useful solution for those who really want
>> to use mutable strings. I bet that, though, after a while they'll evolve
>> to eschew it in favor of immutable strings. It's easier than arguing
>> about it <g>.
> 
> I do agree with the notion that the majority of operations performed
> on strings in a typical application do not modify the string in place.
> However, in performance-oriented server applications, is it very
> common to hold and reuse a mutable buffer between calls to avoid
> the const of reallocation.  

Indeed, in the application I'm currently writing at work, there is not a
single heap allocation after the startup phase. And it cannot be called
trivial in any sense.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list