Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53817 - sandbox/monotonic/libs/monotonic/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-12 06:47:54


Author: cschladetsch
Date: 2009-06-12 06:47:53 EDT (Fri, 12 Jun 2009)
New Revision: 53817
URL: http://svn.boost.org/trac/boost/changeset/53817

Log:
modified to better balance writing to lists or map
Text files modified:
   sandbox/monotonic/libs/monotonic/test/main.cpp | 10 ++++++----
   1 files changed, 6 insertions(+), 4 deletions(-)

Modified: sandbox/monotonic/libs/monotonic/test/main.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/main.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/main.cpp 2009-06-12 06:47:53 EDT (Fri, 12 Jun 2009)
@@ -253,6 +253,7 @@
         typedef monotonic::list<int> List;
         typedef monotonic::map<int, List> Map;
         Map map(storage);
+ size_t mod = count/10;
         for (size_t n = 0; n < count; ++n)
         {
                 int random = rand();
@@ -273,9 +274,10 @@
         typedef std::list<int> List;
         typedef std::map<int, List> Map;
         Map map;
+ size_t mod = count/10;
         for (size_t n = 0; n < count; ++n)
         {
- int random = rand();
+ int random = rand() % mod;
                 Map::iterator iter = map.find(random);
                 if (iter == map.end())
                 {
@@ -293,9 +295,9 @@
 // amount of work the next frame.
 void test_map_list_realtime()
 {
- monotonic::inline_storage<100000> storage;
- const size_t outter_loops = 500;
- const size_t inner_loops = 500;
+ monotonic::inline_storage<1000000> storage;
+ const size_t outter_loops = 1000;
+ const size_t inner_loops = 1000;
 
         boost::timer t0;
         for (int n = 0; n < outter_loops; ++n)


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