Boost logo

Boost Users :

From: Graham (greitz1_at_[hidden])
Date: 2005-05-25 11:28:51

I am rather new to Boost. I apologize in advance if I miss a protocol or
two in the group. Please correct me.


My group is considering using Boost for an application and some members have
expressed concern over the performance of Boost serialization because a
stack dump showed an excess of 100+ calls for a simple example shown below.
Is there a good resource that shows the relative performance of Boost


Code example: (Windows XP, MSVS 2003) Around 389 bytes where serialized.


**example: (it's not pretty but it gets the job done)

void save_schedule(const bus_schedule &s, const char * filename)

    std::ostringstream ss(std::ios::binary); // make an
    std::ofstream ofs("perf.txt"); // output
    LARGE_INTEGER start, finish, diff, frequency; // windows junk
    double duration; //
    char buff[256];


    // adjust priority so high no one can interrupt!

    SetThreadPriority( GetCurrentThread() ,THREAD_PRIORITY_TIME_CRITICAL );


    // perform timed test

    boost::archive::binary_oarchive oa(ss);
    oa << s;


    // compute results

    diff.QuadPart = finish.QuadPart - start.QuadPart;
    duration = ((double)diff.QuadPart)/(frequency.QuadPart) ;
    sprintf( buff, "%f seconds\n", duration );



debug: 0.001636 seconds

release: 0.000712 seconds


Thanks in advance for an assistance.





Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at