Boost logo

Boost :

From: Andrew Schweitzer (a.schweitzer.grps_at_[hidden])
Date: 2005-11-14 23:26:21

Using GetTickCount and GetThreadTimes on Windows XP Pro, recorded time
to execute some simple pieces of logging code in a loop. Divided by loop
iterations to get time per iteration. This is a 3Ghz Pentium. Not sure
how good these tests are, but here's the results:

                elapsed ms thread time ms ns / call (GetTickCount)
(GetThreadTimes) (in thread)
cout 1329 421 42100
enabled log 1469 453 45300
cout "disabled" 15 15 15
disabled log 531 531 531

Here's a little detail on tests
cout, 10,000 times, l_dw increments each loop:
        cout << l_dw << endl;

enabled log, 10,000 times:
        //outside loop:
        //in loop:
        BOOST_SCOPEDLOG(l_lgTest) << l_dw << endl;

cout "disabled", 1,000,000 times:
        //outside loop:
        bool l_bEnabled = false;
        //in loop:
                cout << l_dw << endl;

disabled log, 1,000,000 times:
        //outside loop:
        disable_logs("lgTest"); //this not in loop
        //in loop:
        BOOST_SCOPEDLOG(l_lgTest) << l_dw << endl;

Boost list run by bdawes at, gregod at, cpdaniel at, john at