Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-07-09 21:34:25


Jeff Garland wrote:

> After using it a bit, it seems to me that the immutable approach is likely
> viable for most applications. To see the impact, I wrote a little performance
> test. On mutating operations const_super_string is clearly slower. The
> benefit on non-mutating operations is minimal. However, this version is
> probably not as optimized as possible and it under emphasizes allocation, so I
> expect in actual practice the mutable version may better than these tests
> demonstrate. Your mileage may vary.

There's another strategy that's not done in the tests:
immutable strings returning lazily evaluated views (ala
Fusion). I bet ya, such a strategy will leave both versions
in the dust (especially on compound operations, which BTW
you don't currently have), but I'll avoid making claims for
now. I intend to look into this when I get some time.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk