Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] slow compile times with archive register_type
From: Robert Ramey (ramey_at_[hidden])
Date: 2014-12-13 00:27:21

Elizabeta wrote
> So I found other way for exporting the classes, i.e with archive register
> type. Exporting the classes with register_type is working well, no more
> unregistered_class exceptions, but probelm is it increase the compile
> times of my project by more than half. Project compile time with
> register_type is 40-45 minutes, and without 18-19 minutes. Here is how I
> am using the register_type :
> <snip>
> I am calling register_all_types before doing the
> serialization/deserialization. And I am doing the
> serialization/deserialization in multiple functions in my project not just
> in one place, but this should not be problem, I mean I have the
> registration done only in one cpp file i.e RegisterMyTypes.cpp, so the
> templates should be instantiated only in this file, and it should be slow,
> right ?
> Thank you for any help

No one has every mentioned this before, but then not many people register
100 different data types in the same archive. In any case, once you compile
your register types.cpp you ide/makefile should only re-compile it when it
changes - which I wouldn't think would be very often so I would not expect
this to be an issue. Other than this observation, I can't think what else to
say about this.

Note: you need only register the types for an archive which that archive is
actually going to use. So I'm not sure that making one "register_types.cpp"
for all types in the program is going to be a really great idea. I would
think that this might slow down execution.

Robert Ramey

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at