From: Dean M. B. <mik...@gm...> - 2010-10-21 04:34:44
|
On Thu, Oct 21, 2010 at 2:41 AM, Kim Gräsman <kim...@gm...> wrote: > Hi Dean, > > On Wed, Oct 20, 2010 at 14:39, Dean Michael Berris > <mik...@gm...> wrote: >>> >>> >>> I'm unconvinced that COW strings can be depended on as a central >>> library feature- a quick Google seems to indicate otherwise. >>> >>> http://bit.ly/hiqqU >>> http://bit.ly/cqpKVN >>> >> >> cpp-netlib doesn't depend on COW, but most implementations do >> implement std::string with COW optimizations. This means, GNU's >> libstdc++ has a COW string, Dinkumware (now Microsoft's STL) >> implements it as well. Worrying about copies only matters if it's >> really affecting the performance of the application. > > Microsoft's STL as of VS2008 doesn't use COW, it uses the small-string > optimization. Not sure if they went (back?) to COW in 2010, but I > doubt it. > Oh, then my info on MS STL would still be pre-2008. Thanks for the update. I learn something new everyday. :D > LLVM has an interesting sub-project implementing a standard library > from scratch, and one of the decisions they mention in the overview is > using small string optimization over COW, as if it was a plain truth; > http://libcxx.llvm.org/. > Yeah, I've been following that too. That's interesting, although that will be a C++0x standard library. I don't want to wait for C++0x to come along to make my life a lot easier in implementing cpp-netlib. :D > So, I think there's merit to not expecting COW from std::string. > Yup, but I haven't been writing cpp-netlib to expect COW. I just think that removing copies can be done later on. ;) -- Dean Michael Berris deanberris.com |