|
Boost Users : |
Subject: Re: [Boost-users] [serialization] Runtime overhead of serialization archives
From: georg_at_[hidden]
Date: 2016-09-22 02:35:55
> On 09/21/2016 08:35 PM, Georg Gast wrote:
>> Am 21.09.2016 um 19:36 schrieb Bjorn Reese:
>
>>> The Boost archives use iostreams, whereas cstyle uses memcpy.
>>
>> Yes, thats clear. :)
>
> I am not sure how to interpret your response. My statement was not a
> casual observation about your tests, but the main explanation for the
> difference in performance.
>
> That is one of the reasons why my own archives, unlike the ones
> that are part of Boost.Serialization, are constructed to serialize
> directly to/from other container types such as arrays, std::string,
> and std::vector.
>
I just found out one issue on Windows:
static void to_wire_xml(benchmark::State& state)
{
//std::locale::global(std::locale("C"));
while (state.KeepRunning())
{
boost_test<boost_xml_trait>::to_wire(ev_test());
}
}
If i toggle the commented line, the cost goes down to the half. With the
Windows profiler i found out, that the construction of the locale takes so
much time.
Without global set locale:
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------
to_wire_xml 78066 77177 7479
from_wire_xml 95638 95949 7479
With global set locale:
09/22/16 08:32:49
Benchmark Time(ns) CPU(ns) Iterations
----------------------------------------------
to_wire_xml 41399 41302 16619
from_wire_xml 52841 52844 11218
Thats amazing! Thats the Level of the Linux implementation.
One riddle is solved :)
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