Subject: Re: [boost] [chrono] steady_clock efficiency
From: Kenneth Porter (shiva.blacklist_at_[hidden])
Date: 2011-11-29 21:31:04


"Vicente J. Botet Escriba" <vicente.botet_at_[hidden]> wrote in
news:4ED49A27.2030500_at_[hidden]:

> I have added recently a performance test in
> https://svn.boost.org/svn/boost/branches/release/libs/chrono/perf/store
> _now_in_vector.cpp. I have no access to a windows platform now, but if
> you could run it in your system?

Grepping for "steady" from the output files:

boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_header.test\msvc-
10.0\debug\asynch-exceptions-on\threading-multi
\store_now_in_vector_header.output: steady_clock 649713231 nanoseconds
boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_header.test\msvc-
10.0\release\asynch-exceptions-on\threading-multi
\store_now_in_vector_header.output: steady_clock 697898058 nanoseconds
boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_shared.test\msvc-
10.0\debug\asynch-exceptions-on\threading-multi
\store_now_in_vector_shared.output: steady_clock 645896685 nanoseconds
boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_shared.test\msvc-
10.0\release\asynch-exceptions-on\threading-multi
\store_now_in_vector_shared.output: steady_clock 659919417 nanoseconds
boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_static.test\msvc-
10.0\debug\asynch-exceptions-on\threading-multi
\store_now_in_vector_static.output: steady_clock 646621148 nanoseconds
boost_1_48_0\bin.v2\libs\chrono\perf\store_now_in_vector_static.test\msvc-
10.0\release\asynch-exceptions-on\threading-multi
\store_now_in_vector_static.output: steady_clock 636746989 nanoseconds

So about 650 nanoseconds using a 32-bit build on Vista 64 Ultimate.

BTW, I'd like to suggest changing the output format in the program to put
the times first in fixed-width right-justified format followed by the clock
names, so the times will line up nicely in columns.