Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60005 - in sandbox/statistics/detail/assign/libs/assign: doc example src test
From: erwann.rogard_at_[hidden]
Date: 2010-02-28 19:15:26


Author: e_r
Date: 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
New Revision: 60005
URL: http://svn.boost.org/trac/boost/changeset/60005

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/libs/assign/doc/speed.txt | 8
   sandbox/statistics/detail/assign/libs/assign/doc/speed2.txt | 43 +++++--
   sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp | 1
   sandbox/statistics/detail/assign/libs/assign/src/main.cpp | 5
   sandbox/statistics/detail/assign/libs/assign/test/speed.cpp | 215 +++++++++++++++++++++++++++++++++++++--
   sandbox/statistics/detail/assign/libs/assign/test/speed2.cpp | 193 ++++++++++++++++++-----------------
   sandbox/statistics/detail/assign/libs/assign/test/speed_common.cpp | 4
   sandbox/statistics/detail/assign/libs/assign/test/speed_common.h | 2
   8 files changed, 339 insertions(+), 132 deletions(-)

Modified: sandbox/statistics/detail/assign/libs/assign/doc/speed.txt
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/doc/speed.txt (original)
+++ sandbox/statistics/detail/assign/libs/assign/doc/speed.txt 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -1,9 +1,9 @@
 Output from test/speed.cpp
-Mac OS Leopard 10.6 - x86_64 - Release mode - gcc 4.2
+2.4 GHz Intel Core 2 Duo - Mac OS Leopard 10.6 - x86_64 - Release mode - gcc 4.2
+
+Each arg is a string of size : 100
+Number of repeated function calls : 1000000
 
- Each arg is a string of size : 100
- Number of repeated function calls : 1000000
- N is the number of arguments.
 cref_list_of(1) => 0.00 s
 
 cref_list_of_csv(1) => 0.00 s

Modified: sandbox/statistics/detail/assign/libs/assign/doc/speed2.txt
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/doc/speed2.txt (original)
+++ sandbox/statistics/detail/assign/libs/assign/doc/speed2.txt 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -1,26 +1,41 @@
-Output from cref_list_of2_speed.h for n = 1000 * 1000
-Mac OS Leopard 10.6 - x86_64 - Release mode - gcc 4.2
+Output from speed2.cpp
+2.4 GHz Intel Core 2 Duo - Mac OS Leopard 10.6 - x86_64 - Release mode - gcc 4.2
 
-cref_list_of_csv(1) => 0.02 s
+Each arg is a vec of max size : 100
+Number of repeated function calls : 100000000
 
-cref_list_of<>(1) => 0.01 s
+cref_list_of(1) => 0.13 s
 
-cref_list_of_csv(3) => 0.05 s
+cref_list_of_csv(1) => 0.25 s
 
-cref_list_of<>(3) => 0.01 s
+cref_list_of<>(1) => 0.00 s
 
-cref_list_of_csv(10) => 0.19 s
+list_of(1) => 130.01 s
 
-cref_list_of<>(10) => 0.05 s
 
-cref_list_of_csv(30) => 0.64 s
+cref_list_of(3) => 0.56 s
 
-cref_list_of<>(30) => 0.21 s
+cref_list_of_csv(3) => 1.41 s
 
-cref_list_of_csv(80) => 1.77 s
+cref_list_of<>(3) => 0.39 s
 
-cref_list_of<>(80) => 0.50 s
 
-cref_list_of_csv(160) => 7.52 s
+cref_list_of(10) => 2.10 s
 
-cref_list_of<>(160) => 0.97 s
+cref_list_of_csv(10) => 4.62 s
+
+cref_list_of<>(10) => 1.07 s
+
+
+cref_list_of(30) => 7.31 s
+
+cref_list_of_csv(30) => 14.58 s
+
+cref_list_of<>(30) => 4.03 s
+
+
+cref_list_of(90) => 25.62 s
+
+cref_list_of_csv(90) => 44.08 s
+
+cref_list_of<>(90) => 6.97 s
\ No newline at end of file

Modified: sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/ref_list_of.cpp 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -53,7 +53,6 @@
         }
         {
             BOOST_AUTO(tmp,ref_list_of_csv(a,b,c));
- std::fill(boost::begin(tmp),boost::end(tmp),0);
             tmp.assign(0);
             BOOST_ASSERT(a == 0);
             BOOST_ASSERT(b == 0);

Modified: sandbox/statistics/detail/assign/libs/assign/src/main.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/src/main.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/src/main.cpp 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -1,13 +1,12 @@
 #include <iostream>
 #include <libs/assign/example/ref_list_of.h>
-//#include <libs/assign/test/speed.h>
-//#include <libs/assign/test/speed_csv.h>
+#include <libs/assign/test/speed.h>
 #include <libs/assign/test/speed2.h>
 //#include <libs/assign/test/static_list_of_auto_size.h>
 
 int main (int argc, char * const argv[]) {
 
- example_ref_list_of(std::cout);
+ //example_ref_list_of(std::cout);
         //test_speed(std::cout);
     test_speed2(std::cout);
 // check_static_list_of_auto_size();

Modified: sandbox/statistics/detail/assign/libs/assign/test/speed.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/test/speed.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/test/speed.cpp 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -8,7 +8,11 @@
 #include <boost/progress.hpp>
 #include <boost/bind.hpp>
 #include <boost/typeof/typeof.hpp>
+#include <boost/assign/list_of.hpp>
 #include <boost/assign/auto_size/ref_list_of.hpp>
+#define BOOST_ASSIGN_CSV_SIZE 160
+#include <boost/assign/auto_size/ref_list_of_csv.hpp>
+#undef BOOST_ASSIGN_CSV_SIZE
 #include <libs/assign/test/speed_common.h>
 #include <libs/assign/test/speed.h>
 
@@ -26,6 +30,10 @@
     max_N = 200;
     
     const int n = 1000 * 1000;
+
+ os << "Each arg is a string of size : " << str_len << std::endl;
+ os << "Number of repeated function calls : " << n << std::endl;
+
     int N;
     Vec v;
     std::generate_n(std::back_inserter(v), max_N, boost::bind(&rand_str, str_len));
@@ -33,6 +41,7 @@
     {
         N = 1;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
             timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -42,8 +51,19 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(v[0]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -53,12 +73,23 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of(v[0]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
     {
         N = 3;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -68,8 +99,19 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(v[0],v[1],v[2]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -79,13 +121,24 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of(v[0])(v[1])(v[2]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
     
     {
         N = 10;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -95,8 +148,19 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -106,13 +170,24 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7])(v[8])(v[9]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
     
     {
         N = 30;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -124,8 +199,21 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9]
+ ,v[10],v[11],v[12],v[13],v[14],v[15],v[16],v[17],v[18],v[19]
+ ,v[20],v[21],v[22],v[23],v[24],v[25],v[26],v[27],v[28],v[29]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -137,13 +225,25 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of(v[0])(v[1])(v[2])(v[3])(v[4])(v[5])(v[6])(v[7])(v[8])(v[9])
+ (v[10])(v[11])(v[12])(v[13])(v[14])(v[15])(v[16])(v[17])(v[18])(v[19])
+ (v[20])(v[21])(v[22])(v[23])(v[24])(v[25])(v[26])(v[27])(v[28])(v[29]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
-
     {
         N = 80;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
             timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -160,8 +260,27 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(
+ v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9]
+ ,v[10],v[11],v[12],v[13],v[14],v[15],v[16],v[17],v[18],v[19]
+ ,v[20],v[21],v[22],v[23],v[24],v[25],v[26],v[27],v[28],v[29]
+ ,v[30],v[31],v[32],v[33],v[34],v[35],v[36],v[37],v[38],v[39]
+ ,v[40],v[41],v[42],v[43],v[44],v[45],v[46],v[47],v[48],v[49]
+ ,v[50],v[51],v[52],v[53],v[54],v[55],v[56],v[57],v[58],v[59]
+ ,v[60],v[61],v[62],v[63],v[64],v[65],v[66],v[67],v[68],v[69]
+ ,v[70],v[71],v[72],v[73],v[74],v[75],v[76],v[77],v[78],v[79]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -178,13 +297,31 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of( v[0])( v[1])( v[2])( v[3])( v[4])( v[5])( v[6])( v[7])( v[8])( v[9])
+ (v[10])(v[11])(v[12])(v[13])(v[14])(v[15])(v[16])(v[17])(v[18])(v[19])
+ (v[20])(v[21])(v[22])(v[23])(v[24])(v[25])(v[26])(v[27])(v[28])(v[29])
+ (v[30])(v[31])(v[32])(v[33])(v[34])(v[35])(v[36])(v[37])(v[38])(v[39])
+ (v[40])(v[41])(v[42])(v[43])(v[44])(v[45])(v[46])(v[47])(v[48])(v[49])
+ (v[50])(v[51])(v[52])(v[53])(v[54])(v[55])(v[56])(v[57])(v[58])(v[59])
+ (v[60])(v[61])(v[62])(v[63])(v[64])(v[65])(v[66])(v[67])(v[68])(v[69])
+ (v[70])(v[71])(v[72])(v[73])(v[74])(v[75])(v[76])(v[77])(v[78])(v[79]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
     
     {
         N = 160;
         assert(N < max_N);
+ os << "cref_list_of(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -209,8 +346,35 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of(" << N << ") => ";
         }
+ os << "cref_list_of_csv(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::cref_list_of_csv(
+ v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9]
+ ,v[10],v[11],v[12],v[13],v[14],v[15],v[16],v[17],v[18],v[19]
+ ,v[20],v[21],v[22],v[23],v[24],v[25],v[26],v[27],v[28],v[29]
+ ,v[30],v[31],v[32],v[33],v[34],v[35],v[36],v[37],v[38],v[39]
+ ,v[40],v[41],v[42],v[43],v[44],v[45],v[46],v[47],v[48],v[49]
+ ,v[50],v[51],v[52],v[53],v[54],v[55],v[56],v[57],v[58],v[59]
+ ,v[60],v[61],v[62],v[63],v[64],v[65],v[66],v[67],v[68],v[69]
+ ,v[70],v[71],v[72],v[73],v[74],v[75],v[76],v[77],v[78],v[79]
+ ,v[80],v[88],v[82],v[83],v[84],v[85],v[86],v[87],v[88],v[89]
+ ,v[90],v[91],v[92],v[93],v[94],v[95],v[96],v[97],v[98],v[99]
+ ,v[100],v[101],v[102],v[103],v[104],v[105],v[106],v[107],v[108],v[109]
+ ,v[110],v[111],v[112],v[113],v[114],v[115],v[116],v[117],v[118],v[119]
+ ,v[120],v[121],v[122],v[123],v[124],v[125],v[126],v[127],v[128],v[129]
+ ,v[130],v[131],v[132],v[133],v[134],v[135],v[136],v[137],v[138],v[139]
+ ,v[140],v[141],v[142],v[143],v[144],v[145],v[146],v[147],v[148],v[149]
+ ,v[150],v[151],v[152],v[153],v[154],v[155],v[156],v[157],v[158],v[159]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
+ }
+ os << "cref_list_of<>(" << N << ") => ";
         {
                          timer_ timer;
             for(int i = 0; i < n; ++i)
@@ -235,7 +399,32 @@
                 if(sz != N)
                     os << "ERROR\n";
             }
- os << "cref_list_of<>(" << N << ") => ";
+ }
+ os << "list_of(" << N << ") => ";
+ {
+ timer_ timer;
+ for(int i = 0; i < n; ++i)
+ {
+ BOOST_AUTO(rng, boost::assign::list_of( v[0])( v[1])( v[2])( v[3])( v[4])( v[5])( v[6])( v[7])( v[8])( v[9])
+ (v[10])(v[11])(v[12])(v[13])(v[14])(v[15])(v[16])(v[17])(v[18])(v[19])
+ (v[20])(v[21])(v[22])(v[23])(v[24])(v[25])(v[26])(v[27])(v[28])(v[29])
+ (v[30])(v[31])(v[32])(v[33])(v[34])(v[35])(v[36])(v[37])(v[38])(v[39])
+ (v[40])(v[41])(v[42])(v[43])(v[44])(v[45])(v[46])(v[47])(v[48])(v[49])
+ (v[50])(v[51])(v[52])(v[53])(v[54])(v[55])(v[56])(v[57])(v[58])(v[59])
+ (v[60])(v[61])(v[62])(v[63])(v[64])(v[65])(v[66])(v[67])(v[68])(v[69])
+ (v[70])(v[71])(v[72])(v[73])(v[74])(v[75])(v[76])(v[77])(v[78])(v[79])
+ (v[80])(v[88])(v[82])(v[83])(v[84])(v[85])(v[86])(v[87])(v[88])(v[89])
+ (v[90])(v[91])(v[92])(v[93])(v[94])(v[95])(v[96])(v[97])(v[98])(v[99])
+ (v[100])(v[101])(v[102])(v[103])(v[104])(v[105])(v[106])(v[107])(v[108])(v[109])
+ (v[110])(v[111])(v[112])(v[113])(v[114])(v[115])(v[116])(v[117])(v[118])(v[119])
+ (v[120])(v[121])(v[122])(v[123])(v[124])(v[125])(v[126])(v[127])(v[128])(v[129])
+ (v[130])(v[131])(v[132])(v[133])(v[134])(v[135])(v[136])(v[137])(v[138])(v[139])
+ (v[140])(v[141])(v[142])(v[143])(v[144])(v[145])(v[146])(v[147])(v[148])(v[149])
+ (v[150])(v[151])(v[152])(v[153])(v[154])(v[155])(v[156])(v[157])(v[158])(v[159]));
+ int sz = (int)rng.size();
+ if(sz != N)
+ os << "ERROR\n";
+ }
         }
     }
         os << "<- " << std::endl;

Modified: sandbox/statistics/detail/assign/libs/assign/test/speed2.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/test/speed2.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/test/speed2.cpp 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -21,102 +21,107 @@
 void test_speed2(std::ostream& os)
 {
         os << "-> test_speed : " << std::endl;
- std::vector<int> // 50 items
- a00 = rand_vec(),
- a01 = rand_vec(),
- a02 = rand_vec(),
- a03 = rand_vec(),
- a04 = rand_vec(),
- a05 = rand_vec(),
- a06 = rand_vec(),
- a07 = rand_vec(),
- a08 = rand_vec(),
- a09 = rand_vec(),
- a10 = rand_vec(),
- a11 = rand_vec(),
- a12 = rand_vec(),
- a13 = rand_vec(),
- a14 = rand_vec(),
- a15 = rand_vec(),
- a16 = rand_vec(),
- a17 = rand_vec(),
- a18 = rand_vec(),
- a19 = rand_vec(),
- a20 = rand_vec(),
- a21 = rand_vec(),
- a22 = rand_vec(),
- a23 = rand_vec(),
- a24 = rand_vec(),
- a25 = rand_vec(),
- a26 = rand_vec(),
- a27 = rand_vec(),
- a28 = rand_vec(),
- a29 = rand_vec(),
- a30 = rand_vec(),
- a31 = rand_vec(),
- a32 = rand_vec(),
- a33 = rand_vec(),
- a34 = rand_vec(),
- a35 = rand_vec(),
- a36 = rand_vec(),
- a37 = rand_vec(),
- a38 = rand_vec(),
- a39 = rand_vec(),
- a40 = rand_vec(),
- a41 = rand_vec(),
- a42 = rand_vec(),
- a43 = rand_vec(),
- a44 = rand_vec(),
- a45 = rand_vec(),
- a46 = rand_vec(),
- a47 = rand_vec(),
- a48 = rand_vec(),
- a49 = rand_vec(),
- a50 = rand_vec(),
- a51 = rand_vec(),
- a52 = rand_vec(),
- a53 = rand_vec(),
- a54 = rand_vec(),
- a55 = rand_vec(),
- a56 = rand_vec(),
- a57 = rand_vec(),
- a58 = rand_vec(),
- a59 = rand_vec(),
- a60 = rand_vec(),
- a61 = rand_vec(),
- a62 = rand_vec(),
- a63 = rand_vec(),
- a64 = rand_vec(),
- a65 = rand_vec(),
- a66 = rand_vec(),
- a67 = rand_vec(),
- a68 = rand_vec(),
- a69 = rand_vec(),
- a70 = rand_vec(),
- a71 = rand_vec(),
- a72 = rand_vec(),
- a73 = rand_vec(),
- a74 = rand_vec(),
- a75 = rand_vec(),
- a76 = rand_vec(),
- a77 = rand_vec(),
- a78 = rand_vec(),
- a79 = rand_vec(),
- a80 = rand_vec(),
- a81 = rand_vec(),
- a82 = rand_vec(),
- a83 = rand_vec(),
- a84 = rand_vec(),
- a85 = rand_vec(),
- a86 = rand_vec(),
- a87 = rand_vec(),
- a88 = rand_vec(),
- a89 = rand_vec();
-
- typedef boost::progress_timer timer_;
     
- const int n = 100 * 1000 * 1000;
+ const int m = 100; // max size of vec
+ const int n = 100 * 1000 * 1000; // number of loops
+
+ os << "Each arg is a vec of max size : " << m << std::endl;
+ os << "Number of repeated function calls : " << n << std::endl;
     
+ std::vector<int>
+ a00 = rand_vec(m),
+ a01 = rand_vec(m),
+ a02 = rand_vec(m),
+ a03 = rand_vec(m),
+ a04 = rand_vec(m),
+ a05 = rand_vec(m),
+ a06 = rand_vec(m),
+ a07 = rand_vec(m),
+ a08 = rand_vec(m),
+ a09 = rand_vec(m),
+ a10 = rand_vec(m),
+ a11 = rand_vec(m),
+ a12 = rand_vec(m),
+ a13 = rand_vec(m),
+ a14 = rand_vec(m),
+ a15 = rand_vec(m),
+ a16 = rand_vec(m),
+ a17 = rand_vec(m),
+ a18 = rand_vec(m),
+ a19 = rand_vec(m),
+ a20 = rand_vec(m),
+ a21 = rand_vec(m),
+ a22 = rand_vec(m),
+ a23 = rand_vec(m),
+ a24 = rand_vec(m),
+ a25 = rand_vec(m),
+ a26 = rand_vec(m),
+ a27 = rand_vec(m),
+ a28 = rand_vec(m),
+ a29 = rand_vec(m),
+ a30 = rand_vec(m),
+ a31 = rand_vec(m),
+ a32 = rand_vec(m),
+ a33 = rand_vec(m),
+ a34 = rand_vec(m),
+ a35 = rand_vec(m),
+ a36 = rand_vec(m),
+ a37 = rand_vec(m),
+ a38 = rand_vec(m),
+ a39 = rand_vec(m),
+ a40 = rand_vec(m),
+ a41 = rand_vec(m),
+ a42 = rand_vec(m),
+ a43 = rand_vec(m),
+ a44 = rand_vec(m),
+ a45 = rand_vec(m),
+ a46 = rand_vec(m),
+ a47 = rand_vec(m),
+ a48 = rand_vec(m),
+ a49 = rand_vec(m),
+ a50 = rand_vec(m),
+ a51 = rand_vec(m),
+ a52 = rand_vec(m),
+ a53 = rand_vec(m),
+ a54 = rand_vec(m),
+ a55 = rand_vec(m),
+ a56 = rand_vec(m),
+ a57 = rand_vec(m),
+ a58 = rand_vec(m),
+ a59 = rand_vec(m),
+ a60 = rand_vec(m),
+ a61 = rand_vec(m),
+ a62 = rand_vec(m),
+ a63 = rand_vec(m),
+ a64 = rand_vec(m),
+ a65 = rand_vec(m),
+ a66 = rand_vec(m),
+ a67 = rand_vec(m),
+ a68 = rand_vec(m),
+ a69 = rand_vec(m),
+ a70 = rand_vec(m),
+ a71 = rand_vec(m),
+ a72 = rand_vec(m),
+ a73 = rand_vec(m),
+ a74 = rand_vec(m),
+ a75 = rand_vec(m),
+ a76 = rand_vec(m),
+ a77 = rand_vec(m),
+ a78 = rand_vec(m),
+ a79 = rand_vec(m),
+ a80 = rand_vec(m),
+ a81 = rand_vec(m),
+ a82 = rand_vec(m),
+ a83 = rand_vec(m),
+ a84 = rand_vec(m),
+ a85 = rand_vec(m),
+ a86 = rand_vec(m),
+ a87 = rand_vec(m),
+ a88 = rand_vec(m),
+ a89 = rand_vec(m);
+
+ typedef boost::progress_timer timer_;
+
     {
         int const N = 1;
         os << "cref_list_of(" << N << ") => ";

Modified: sandbox/statistics/detail/assign/libs/assign/test/speed_common.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/test/speed_common.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/test/speed_common.cpp 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -32,10 +32,10 @@
 }
 
 std::vector<int>
-rand_vec()
+rand_vec(int max_n)
 {
     std::vector<int> result(
- (std::size_t)rand(1, 100)
+ (std::size_t)rand(1, max_n)
     );
     std::generate(
         result.begin(),

Modified: sandbox/statistics/detail/assign/libs/assign/test/speed_common.h
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/test/speed_common.h (original)
+++ sandbox/statistics/detail/assign/libs/assign/test/speed_common.h 2010-02-28 19:15:23 EST (Sun, 28 Feb 2010)
@@ -11,6 +11,6 @@
 int rand(int M, int N);
 char rand_letter();
 std::string rand_str(int len);
-std::vector<int> rand_vec();
+std::vector<int> rand_vec(int);
 
 #endif
\ No newline at end of file


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