|
Boost : |
From: Alex Besogonov (cyberax_at_[hidden])
Date: 2005-08-15 09:20:09
Kim Barrett wrote:
> There was some discussion of this in late July, subject
> "Boost.Serialization archive constructor performance". A brief
> summary of that thread:
> I encountered similar issues with archive construction significantly
> impacting throughput. I patched the source to allow archive reuse, and
> did indeed find that it had a significant impact. But it is not clear
> where the time is actually going. My first thought was that the construction
> of some archive members which are STL containers was using up lots of time,
> but examining those constructors in detail didn't seem to support this.
I've managed to pinpoint the bottleneck: it's containers reallocations
of dynamic storage. Each time serialization is performed at least one
dynamic memory allocation for each container is neccessary.
If containers are reused then these allocations are performed only once,
because STL containers don't deallocate underlying storage in their
clear/reset/... methods.
-- With respect, Alex Besogonov (cyberax_at_[hidden])
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk