[xsd-users] Binary serialization performance in version 4.0.0 vs 3.3.0

svetlana.samsonik at thomsonreuters.com svetlana.samsonik at thomsonreuters.com
Sun Oct 26 17:52:04 EDT 2014


Hi Boris,

Please see my answers in blue below:





> I ran the tests in the 'performance' example and received very similar

> results.

>

> I my own test are slightly different. I changed the example code to

> mimic the my logic and I received similar results to yours for parsing

> and serialization.



>>So, just to confirm, you have changes the 'performance' test to mimic your logic but still used the "dummy" schema that >>comes with the test?

>>And the result was that the numbers for 3.3.0 and 4.0.0 were very close, correct?



Yes, correct.





> When I run the those tests for "real" schema (which is complicated)

> and file size 25K, I receive the following results



>>I am not sure what you mean by "those tests". The output that you showed doesn't look like the 'performance' test. And it doesn't have the binary serialization part. Did you add this to the 'performance'.



My tests are for "real schema". For parsing and serialization they are the same as 'performance' tests plus have

binary serialization measurements.



No, did not add  binary serialization part to the 'performance' test.



> My biggest concern is "Copy from XDR to C++/Tree object" where it is

> 4 times longer to compare with "Serialize C++/Tree object to XRD" in

> version 4.0, where it is only 2 times in version 3.3.0.

>

> I ran valgrind --tool=callgrind for both test and you can see that the

> same function (loadFromXDR) has much more "Ir per call" for version

> 4.0 (first picture) vs version 3.3 ( second picture).



>>This is interesting. Could you do two things for me:



>>1. Build your 4.0.0 test in the c++98 rather than c++11 mode and see

   if there are any differences.



My new results in microseconds for version 4.0.0



                                     --std c++98 -O0  --std c++98 -O2   --std c++11 -O0   --std c++11 -O2



Parse XML to C++/Tree object:         4715            4667              5420              5648

Serialize C++/Tree object to XML:     4998            5082              5735              6038

Serialize C++/Tree object to XRD:     325             356               329               332

Copy from XDR to C++/Tree object:     725             765               1405              1444





>>2. Send the power::newMessage(XDR) constructor body for both 3.3.0

   and 4.0.0. I have looked at a few such constructors from the

   examples and they look almost identical. There are a few extra

   inline function calls in 4.0.0 but they definitely cannot explain

   this difference (unless you built with optimization disabled).



Both constructors are identical for 3.3.0 and 4.0.0:


   namespace power
  {
  newsMessage::
  newsMessage (::xml_schema::istream< XDR >& s,
               ::xml_schema::flags f,
               ::xml_schema::container* c)
  : ::xml_schema::type (s, f, c),
    header_ (this),
    itemSet_ (this)
  {
    this->parse (s, f);
  }





Thank you,

Svetlana


More information about the xsd-users mailing list