|
Boost : |
From: Igor Kholodov (C.JUMP_at_[hidden])
Date: 2004-09-26 20:00:24
>>> Igor Kholodov <C.JUMP_at_[hidden]> wrote:
>>>
>>>> I am testing immutable string outside boost, using
>> it
>>>> as string type with common text transformation
>> library
>>>> (http://cttl.sourceforge.net/). It works quite
well,
>>>> about 18% speed is gained while parsing large XML
>>>> documents (>1MB) when using const_string.
>>>
>>> Could you please specify the compiler and STL
>> implementation you use?
>>>
>>
>> Tested with GCC 3.4.1 (mingw) and GCC 3.2.3 on
linux.
>
>Then, I think, the results are very good because GNU
ISO
>C++ implementation of std::basic_string<> uses
representation sharing with
>reference counting, which is the same thing that
const_string<> does. The
>only difference between the std::basic_string<> and
const_string<> is that
>the latter one uses small string optimization, and, I
think, this is what
>makes it look better.
>
Glad if this helps. Any plans in the future
to add reverse iterator support to const_string?
I wrote some code to work around the absence
of const_reverse_iterator, rbegin(), and rend(),
all of which would be nice to have available.
Regards,
Igor Kholodov
http://cttl.sourceforge.net/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk