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

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4307: basic_oarchive optimization
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-08 05:58:50


#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: |
--------------------------+-------------------------------------------------

Comment(by anonymous):

 why? because of instantiation?

 the type_id itself can change between saving and loading, e.g. when
 loading an archive the internal type_id can be 5 while the class_id saved
 in the archive is 10.

 the type_id is only used for internal bookkeeping. before the patch the
 mapping was

 type_info -> cobject{ class_id }
 (through a std::set keyed on type_info)

 after the patch it is:

 type_info -> type_id -> cobject{ class_id }

 with type_id incidentally used as class_id, because I assumed the order of
 the class_id doesn't matter. but that can be changed, if you want the
 class_ids to be assigned sequentially.

 I think I'm going to map the type_ids to "cobject" by an intrusive
 unordered_map, too, though. that is almost as good as vector lookup(almost
 perfect hash function), and doesn't have the 10000-initialization problem
 described above.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4307#comment:5>
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