views:

166

answers:

2

Hello,

Has anybody used SmallObjectAllocator from Modern C++ Design by Andrei Alexandrescu in a big project? I want to implement this allocator but I need some opinions about it before using it in my project. I made some tests and it seems very fast, but the tests were made in a small test environment. I want to know how fast it is when are lots of small objects(like events, smart pointers, etc) and how much extra memory it uses.

+1  A: 

Have you considered using Boost Pool Library ?

Konstantin
Yes, but I prefer to use internal code.
Felics
Why Felics? Boost does not hurt
Nikko
@Felics: Do you suffer from not-invented-here syndrome? Remember, the best code is the code you never have to write.
John Dibling
If I use code from a book it is clear that it is not invented "here", but we always had some problems with code from other libraries and it is very difficult to debug/track the problem it nobody knows anything about that code. Any library has bugs, more or less. I've worked on a very big project that used xpdf, libtiff, libpng, libjpeg, zlib, freetype and other open source projects(many of them, it was a PDF editor) and when the clients reported bugs and the bugs were from a library it was very hard to solved them. Another problem is that many open source libraries are not for commercial use
Felics
The Boost library is an exception to that: commercial support is available, and it's free for commercial use. Sure, it might have bugs left, but considering its widespread use I'm 100% certain it has less bugs than your in-house code.
MSalters
I agree with Felics on this. If the code is relative small, it might be better to write it yourself: You know what you did, You can extend it yourself, and maybe you even learned something while doing it.Especially with Boost, I have some bad experience with Boost. Just using the rather easy DateTime class caused my compilations to slow down with a factor of 3 ! Just because Boost seems to do everything with templates (making it very hard to forward declare types)
Patrick
+3  A: 

I suggest you ask Rich Sposato. He has done extensive work on Loki's small object allocator, including testing and benchmarks.

Andrei