1

Does serializing a binary sequence stored in vector cost much? For example if I am using binary archive. Will the boost::serialization library put characters to differentiate char elements of vector and make the output larger?

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
jnbrq -Canberk Sönmez
  • 1,790
  • 1
  • 17
  • 29

1 Answers1

0

Measure it!

The sort answers:

  • No it doesn't cost much. Profile it (and see whether it fits your application)
  • No, vector elements will not be differentiated for vectors of POD types.
    (Things change when you serialize vectors containing pointers to polymorphic classes. This is obvious, since it couldn't be done more efficiently unless you have extra knowledge about the particular dataset)

The storage cost:

Longer answers:

The runtime cost:

Community
  • 1
  • 1
sehe
  • 374,641
  • 47
  • 450
  • 633