It could be that I'm being foolish, or that there is something very
strange going on in how the Boost serialization library interacts with
the Intel C++ compiler that I don't understand. I'll post a short
question first, eliding underlying motivations, to see if this
warrants further discussion.
I am running on 64-bit Linux, using the Intel C++ compiler, version
9.0, and gcc 3.4.5.
I have a large, complex data structure that I am serializing. All
serialize methods use the BOOST_SERIALIZATION_NVP macro. The data
structure serializes and deserializes accurately for each of text,
xml, and binary archives. The size on disk is about 250 megabytes,
using the binary archives.
The load method I use is roughly this:
#include
#include
//#include
//#include
//#include
//#include
#include "Foo.hh"
Foo* load(const string& filename) {
istream ifs(filename.c_str(), ios::binary);
Foo* foo = 0;
boost::archive::binary_iarchive ia(ifs);
ia >> BOOST_SERIALIZATION_NVP(foo);
return foo;
}
Above this method, note the commented-out text and xml archive
headers.
Here is the strange part: When using the Intel compiler, and run with
the text and xml archive headers commented out, the load method takes
about 9.6 seconds. When I uncomment the text and xml headers, the
load time almost doubles, to 18.8 seconds or so. I do not see
this with gcc.
So the question is: have I done something foolish here, or is this
wacky?
I am using the following command to compile the code:
% icpc -O2 -Ob2 -ip <...>
Any help appreciated.
Bill