Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54084 - sandbox/monotonic/libs/monotonic/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-18 23:28:34


Author: cschladetsch
Date: 2009-06-18 23:28:34 EDT (Thu, 18 Jun 2009)
New Revision: 54084
URL: http://svn.boost.org/trac/boost/changeset/54084

Log:
slight reformatting

Text files modified:
   sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp | 37 ++++++++++++++++---------------------
   1 files changed, 16 insertions(+), 21 deletions(-)

Modified: sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/compare_memory_pool.cpp 2009-06-18 23:28:34 EDT (Thu, 18 Jun 2009)
@@ -1,10 +1,11 @@
-#include <ios>
+#include <iostream>
 #include <iomanip>
 #include <list>
 #include <numeric>
 #include <vector>
-#include <boost/pool/pool.hpp>
+
 #include <boost/pool/pool_alloc.hpp>
+#include <boost/monotonic/allocator.hpp>
 
 struct Unaligned
 {
@@ -111,12 +112,18 @@
 template <class Fun>
 PoolResult compare_memory_pool(size_t count, size_t length, Fun fun)
 {
- typedef std::vector<int, boost::pool_allocator<int,
- boost::default_user_allocator_new_delete,
- boost::details::pool::null_mutex> > pool_v;
- typedef std::vector<int, boost::fast_pool_allocator<int,
- boost::default_user_allocator_new_delete,
- boost::details::pool::null_mutex> > fast_pool_v;
+ typedef std::vector<
+ int
+ , boost::fast_pool_allocator<int
+ , boost::default_user_allocator_new_delete
+ , boost::details::pool::null_mutex> >
+ fast_pool_v;
+ typedef std::vector<
+ int
+ , boost::pool_allocator<int
+ , boost::default_user_allocator_new_delete
+ , boost::details::pool::null_mutex> >
+ pool_v;
         typedef std::vector<int, boost::monotonic::allocator<int> > mono_v;
         typedef std::vector<int > std_v;
 
@@ -139,8 +146,7 @@
                 result.fast_pool_elapsed = timer.elapsed();
         }
 
- // test boost::pool_allocator.
- if (1)
+ // test boost::pool_allocator
         {
                 srand(42);
                 boost::timer timer;
@@ -156,10 +162,6 @@
                 }
                 result.pool_elapsed = timer.elapsed();
         }
- else
- {
- result.pool_elapsed = -1;
- }
 
         // test monotonic
         {
@@ -176,9 +178,7 @@
                 result.mono_elapsed = timer.elapsed();
         }
 
-
         // test local monotonic
- if (1)
         {
                 srand(42);
                 monotonic::local<> storage;
@@ -195,7 +195,6 @@
         }
 
         // test std
- if (1)
         {
                 srand(42);
                 boost::timer timer;
@@ -227,12 +226,10 @@
 void PrintResults(PoolResults const &results)
 {
         size_t w = 10;
- //cout << setw(0) << "count" << setw(w) << "fast_p" << setw(w) << "pool" << setw(w) << "std" << setw(w) << "mono" << setw(w) << "local" << setw(w) << "fp/mono" << setw(w) << "fp/local" << endl;
         cout << setw(0) << "count" << setw(w) << "fast_p" << setw(w) << "pool" << setw(w) << "std" << setw(w) << "mono" << setw(w) << "local" << setw(w) << "fp/mono" << setw(w) << "pool/mono" << endl;
         BOOST_FOREACH(PoolResults::value_type const &iter, results)
         {
                 PoolResult const &result = iter.second;
- //cout << setw(0) << setprecision(4) << iter.first << setw(w) <<result.fast_pool_elapsed << setw(w) << result.pool_elapsed << setw(w) << result.std_elapsed << setw(w) << result.mono_elapsed << setw(w) << result.local_mono_elapsed << setw(w) << 100.*result.fast_pool_elapsed/result.mono_elapsed << "%" << setw(w) << 100.*result.fast_pool_elapsed/result.local_mono_elapsed << "%" <<endl;
                 cout << setw(0) << setprecision(4) << iter.first << setw(w) <<result.fast_pool_elapsed << setw(w) << result.pool_elapsed << setw(w) << result.std_elapsed << setw(w) << result.mono_elapsed << setw(w) << result.local_mono_elapsed << setw(w) << 100.*result.fast_pool_elapsed/result.mono_elapsed << "%" << setw(w) << 100.*result.pool_elapsed/result.mono_elapsed << "%" <<endl;
         }
 }
@@ -245,7 +242,6 @@
         PrintResults(compare_memory_pool(50000, 2000, 10, thrash_pool_iter()));
         cout << "thrash_pool_sort" << endl;
         PrintResults(compare_memory_pool(1000, 1000, 10, thrash_pool_sort()));
-
         cout << "thrash_pool_sort_list_int" << endl;
         PrintResults(compare_memory_pool(1000, 2000, 10, thrash_pool_sort_list_int()));
         cout << "thrash_pool_map_list_unaligned" << endl;
@@ -253,4 +249,3 @@
 }
 
 //EOF
-


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