|
Boost Users : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-10-23 09:52:26
Ovanes Markarian wrote:
> Well, I have messages consisting from multiple optional smaller
> object instances. I would like to try the approach described in A.
> Alexandrescu's Modern C++ Design: Small Object Allocator.
> Unfortunately I can not use it directly from Loki lib, since it does
> not have interface described in c++ standard for std::allocator.
>
> I think 2% in such a small piece of software, which constists let's
> say from ca. 7 such small pieces can turn out into a 14% perfromance
> increase if a good allocation strategy can be found.
I wouldn't bet on that. The default allocator in g++ is reasonably good; it
already has small block support built-in. Beating it by 14% will be quite a
challenge in a real application (you could probably do it in a
microbenchmark, though.) In addition, when multiple threads and CPU cores
enter the picture, most simplistic small object allocators that use a single
mutex perform rather badly. This includes quick_allocator. :-)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net