Re: [Boost-bugs] [Boost C++ Libraries] #7422: Provide a condition variable with zero-overhead performance penality

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7422: Provide a condition variable with zero-overhead performance penality
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-13 13:41:41


#7422: Provide a condition variable with zero-overhead performance penality
------------------------------------------+---------------------------------
  Reporter: maxim.yegorushkin@… | Owner: viboes
      Type: Feature Requests | Status: assigned
 Milestone: To Be Determined | Component: thread
   Version: Boost 1.51.0 | Severity: Regression
Resolution: | Keywords: condition_variable
------------------------------------------+---------------------------------

Comment (by maxim.yegorushkin@…):

 Okay, I've made a little benchmark.

 Is is a producer-consumer ping-pong benchmark. It aims to benchmark
 condition variables with and without thread cancellation support by
 comparing the time it took to complete the benchmark.

 Condition variable with thread cancellation support is
 boost::condition_variable from boost-1.51. Without -
 std::condition_variable that comes with gcc-4.7.2.

 One producer, one to CONSUMER_MAX consumers. The benchmark calls
 condition_variable::notify_all() without holding a mutex to maximize
 contention within this function. Each benchmark for a number of consumers
 is run three times and the best time is picked to get rid of outliers.

 The results are reported for each benchmark for a number of consumers. The
 most important number is (std - boost) / std * 100. Positive numbers are
 when boost::condition_variable is faster, negative it is slower.

 The test shows that boost::condition_variable is around 8% slower than
 std::condition_variable. I made plots but Trac doesn't allow to post links
 here.

 I ran the benchmark on Fedora 17 with gcc-4.7.2 with real-time FIFO
 priority in init mode 3.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7422#comment:12>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC