[Boost-bugs] [Boost C++ Libraries] #4307: basic_oarchive optimization

Subject: [Boost-bugs] [Boost C++ Libraries] #4307: basic_oarchive optimization
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-06 21:15:06


#4307: basic_oarchive optimization
--------------------------+-------------------------------------------------
 Reporter: anonymous | Owner: ramey
     Type: Patches | Status: new
Milestone: Boost 1.43.0 | Component: serialization
  Version: Boost 1.44.0 | Severity: Optimization
 Keywords: |
--------------------------+-------------------------------------------------
 attached are patches that optimizes memory allocation and runtime
 complexity of basic_oarchive.
 it should not change any serialization behaviour, and archives by the
 patched basic_oarchive can be read by the unpatched basic_iarchive.

 what the patch does in detail:
  - replace log(O) lookup of "cobject" class info for each
    serialized class with a log(1) vector lookup. avoids
    container node allocation.
  - replace log(O) lookup of "aobject" object tracking info
    with log(1) hashing. avoids container node allocation.
  - use allocation pools for "aobject" object tracking info
  - store whether a class was stored as a pointer inside
    the "cobject" class info, to remove std::set stored_pointers

 before:
  - 4 allocations on construction
  - 1 allocation for each serialized class, tracked or not
  - 1 allocation for each tracked object
 after:
  - 1 allocation on construction(PIMPL)
  - no allocation for classes if less than 256 classes are serialized.
    1 allocation for 512 classes, 2 for 1024, ...
  - no allocation for object tracking if less than 256 objects are
 serialized.
    after that, about 1 allocation for 16 tracked objects

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4307>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC