Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73499 - in sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark: . detail
From: cpp.cabrera_at_[hidden]
Date: 2011-08-03 04:17:18


Author: alejandro
Date: 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
New Revision: 73499
URL: http://svn.boost.org/trac/boost/changeset/73499

Log:
Restructured benchmarks to eliminate re-instantiation step.
Text files modified:
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/.gitignore | 2 ++
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/bloom_insert.cpp | 10 +++++-----
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/benchmark.hpp | 4 ++++
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/dynamic_benchmark.hpp | 4 ++++
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/dynamic_bloom_insert.cpp | 10 +++++-----
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdhash_insert.cpp | 10 +++++-----
   sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdset_insert.cpp | 10 +++++-----
   7 files changed, 30 insertions(+), 20 deletions(-)

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/.gitignore
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/.gitignore (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/.gitignore 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -2,3 +2,5 @@
 stdhash_insert
 stdset_insert
 dynamic_bloom_insert
+meta_compare
+makefile

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/bloom_insert.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/bloom_insert.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/bloom_insert.cpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -32,14 +32,14 @@
   boost::progress_display progress(REPEAT);
   double total_time = 0.0;
 
- for (size_t i = 0; i < REPEAT; ++i, ++progress) {
- benchmark<int, OPS,
- generator<int>,
- basic_bloom_filter<int, BITS> > bench;
+ benchmark<int, OPS,
+ generator<int>,
+ basic_bloom_filter<int, BITS> > bench;
 
+ for (size_t i = 0; i < REPEAT; ++i, ++progress) {
     bench.run();
-
     total_time += bench.time();
+ bench.reset();
   }
 
   cout << REPEAT << " trials of " << OPS << " insertions took "

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/benchmark.hpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/benchmark.hpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/benchmark.hpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -35,6 +35,10 @@
         }
         test_time = timer.elapsed();
       }
+
+ void reset() {
+ test_time = 0.0;
+ }
       
     private:
       Container container;

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/dynamic_benchmark.hpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/dynamic_benchmark.hpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/detail/dynamic_benchmark.hpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -37,6 +37,10 @@
         test_time = timer.elapsed();
       }
 
+ void reset() {
+ test_time = 0.0;
+ }
+
     private:
       Container container;
       Generator gen;

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/dynamic_bloom_insert.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/dynamic_bloom_insert.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/dynamic_bloom_insert.cpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -32,14 +32,14 @@
   boost::progress_display progress(REPEAT);
   double total_time = 0.0;
 
- for (size_t i = 0; i < REPEAT; ++i, ++progress) {
- benchmark<int, OPS,
- generator<int>,
- dynamic_bloom_filter<int> > bench(BITS);
+ benchmark<int, OPS,
+ generator<int>,
+ dynamic_bloom_filter<int> > bench(BITS);
 
+ for (size_t i = 0; i < REPEAT; ++i, ++progress) {
     bench.run();
-
     total_time += bench.time();
+ bench.reset();
   }
 
   cout << REPEAT << " trials of " << OPS << " insertions took "

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdhash_insert.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdhash_insert.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdhash_insert.cpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -31,14 +31,14 @@
   boost::progress_display progress(REPEAT);
   double total_time = 0.0;
 
- for (size_t i = 0; i < REPEAT; ++i, ++progress) {
- benchmark<int, OPS,
- generator<int>,
- boost::unordered_set<int> > bench;
+ benchmark<int, OPS,
+ generator<int>,
+ boost::unordered_set<int> > bench;
 
+ for (size_t i = 0; i < REPEAT; ++i, ++progress) {
     bench.run();
-
     total_time += bench.time();
+ bench.reset();
   }
 
   cout << REPEAT << " trials of " << OPS << " insertions took "

Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdset_insert.cpp
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdset_insert.cpp (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/benchmark/stdset_insert.cpp 2011-08-03 04:17:16 EDT (Wed, 03 Aug 2011)
@@ -31,14 +31,14 @@
   boost::progress_display progress(REPEAT);
   double total_time = 0.0;
 
- for (size_t i = 0; i < REPEAT; ++i, ++progress) {
- benchmark<int, OPS,
- generator<int>,
- std::set<int> > bench;
+ benchmark<int, OPS,
+ generator<int>,
+ std::set<int> > bench;
 
+ for (size_t i = 0; i < REPEAT; ++i, ++progress) {
     bench.run();
-
     total_time += bench.time();
+ bench.reset();
   }
 
   cout << REPEAT << " trials of " << OPS << " insertions took "


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk