Boost logo

Boost :

From: Trey Jackson (tjackson_at_[hidden])
Date: 2003-10-23 15:03:57


Anders Hybertz wrote:
>I'm sitting and reading an article in the latest Dr. Dobb's Journal -
>October 2003 issue.
>
>There is quite an interesting article on "C++ String Performance" -
>the guy has made some kind of string implementation that performs
>between 2 and 25.000 times better than the std:string or
>std::basic_string<T>. Especially the performance gains in
>multithreaded application is outstanding.

I'm still having trouble with the fact that Dr. Dobbs published such a
hack. Even I was able to figure out a bunch of the shortcomings of
the implementation (wasted memory, incompatible string types, ...)

He incorrectly "determines" the cause of the slowdown.
FWIW, simply setting the environment variable

  GLIBCPP_FORCE_NEW (GLIBCXX_FORCE_NEW for gcc 3.4+)

which disables memory caching gets the std::string example to within
10% of his CGenString example (teststring4).

see...

   http://gcc.gnu.org/onlinedocs/libstdc++/ext/howto.html#3

(tested using gcc 3.2.3)

TJ

-- 
Trey Jackson
tjackson_at_[hidden]
"Why, the fax machine is nothing but
 a waffle iron with a phone attached!"
-- Grandpa Simpson

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