Boost logo

Boost Users :

Subject: Re: [Boost-users] New and updated serialization performance results
From: Brian Wood (woodbrian77_at_[hidden])
Date: 2009-03-03 15:10:28


Robert Ramey writes:
>Given your interest in this topic, you might want to take a look at
>
>boost/libs/serialization/performance.
>
>included with the boost 1.38 package.
>
>There is a Jamfile.v2 in that directory and everything is set
>up just the way boost testing is.  The only difference is
>that, using the GCC compiler, a function by function
>time table is generated which pinpoints where time
>is being consumed. This would help answer such questions
>as "what if I replaced std::string with something else".
>
>I only included a couple of performance tests to
>demonstrate the system. I havn't had time to make
>a more complete set of tests.  Ideally, I would like
>to see your tests included for comparison.

The source code on webEbenezer.net is not copyright
protected, so anyone interested in doing what you
suggest is welcome to do so. I doubt I'm going to be
able to do that anytime soon.

>
>My question has always been that since serialization
>(in at least the simpler cases) just boils down
>to writing out the data, whether the code is
>generated by one template or another shouldn't
>make a big difference.  That is, at the end of the
>day, the sequence of operations should be pretty
>much the same whether one is hand rolling the code
>or whether it is generated by templates.
>

It may have something to do with your use of iostreams.
I don't think that accounts for all of the difference, but my
guess is it's a big part of it.

In my opinion using insert with a hint is an easy way to
improve the performance of the Boost Serialization library
when loading instances of (multi)set, multi(map) and rb_tree.
To my knowledge the only draw back with that is if someone
is serializing from say a list<int> to a set<int> and the data
in the list is not ordered. In that case using a hint would
impede performance. Since that situation does not come
up a lot, I think using hinted inserts as a default makes
sense.

We plan to change (this month) from a default of "regular"
insert functions to hinted inserts for the types mentioned
here. Currently we have a @hi option to turn on hinted
inserts. That will change to @nohi to turn them off and
could be used if data from a non-ordered list<int> is being
sent to a set<int>.

Brian Wood
Ebenezer Enterprises
www.webEbenezer.net

"Then Samuel took a rock and set it up between Mizpah
and Shen. He named it Ebenezer [Rock of Help] and said,
'Until now the LORD has helped us.'"


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net