Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51599 - sandbox/reference_closure
From: dave_at_[hidden]
Date: 2009-03-04 00:23:41


Author: dave
Date: 2009-03-04 00:23:38 EST (Wed, 04 Mar 2009)
New Revision: 51599
URL: http://svn.boost.org/trac/boost/changeset/51599

Log:
Increase number of iterations again to ensure stability

Add ability to disable work for measurement purposes

Time doug's tr1::function copy ctor optimization that tests a bit and
avoids indirect call

Text files modified:
   sandbox/reference_closure/main.cc | 2 +-
   sandbox/reference_closure/timings.txt | 27 +++++++++++++++++++++++++++
   sandbox/reference_closure/trivial_closure.h | 2 ++
   sandbox/reference_closure/trivial_initiator.h | 6 +++++-
   4 files changed, 35 insertions(+), 2 deletions(-)

Modified: sandbox/reference_closure/main.cc
==============================================================================
--- sandbox/reference_closure/main.cc (original)
+++ sandbox/reference_closure/main.cc 2009-03-04 00:23:38 EST (Wed, 04 Mar 2009)
@@ -1,7 +1,7 @@
 #include "trivial_initiator.h"
 
 int main() {
- for ( int i = 0; i < 1000*1000*100; i++ )
+ for ( int i = 0; i < 1000*1000*1000; i++ )
        initiator();
     return 0;
 }

Modified: sandbox/reference_closure/timings.txt
==============================================================================
--- sandbox/reference_closure/timings.txt (original)
+++ sandbox/reference_closure/timings.txt 2009-03-04 00:23:38 EST (Wed, 04 Mar 2009)
@@ -68,4 +68,31 @@
 
 t(std::function<>) / t(reference_closure): 3.2
 
+=== Multiply Iterations by 10 Again ===
+
+execute refclosure
+real 0m16.620s
+user 0m16.489s
+sys 0m0.053s
+
+execute stdfunction
+real 0m51.779s
+user 0m51.640s
+sys 0m0.059s
+
+t(std::function<>) / t(reference_closure): 3.1
+
+=== Eliminate Indirect Call in copy c'tor of std::function<...> ===
+
+execute refclosure
+real 0m16.174s
+user 0m16.034s
+sys 0m0.044s
+
+execute stdfunction
+real 0m33.195s
+user 0m33.047s
+sys 0m0.052s
+
+t(std::function<>) / t(reference_closure): 2.1
 

Modified: sandbox/reference_closure/trivial_closure.h
==============================================================================
--- sandbox/reference_closure/trivial_closure.h (original)
+++ sandbox/reference_closure/trivial_closure.h 2009-03-04 00:23:38 EST (Wed, 04 Mar 2009)
@@ -5,7 +5,9 @@
 
 inline void work( frame* f )
 {
+# if !DISABLE_WORK
     f->a += f->b * f->c;
+# endif
 }
 
 #if REFERENCE_CLOSURE

Modified: sandbox/reference_closure/trivial_initiator.h
==============================================================================
--- sandbox/reference_closure/trivial_initiator.h (original)
+++ sandbox/reference_closure/trivial_initiator.h 2009-03-04 00:23:38 EST (Wed, 04 Mar 2009)
@@ -2,7 +2,11 @@
 #include "parallel_lib.h"
 
 void initiator() {
- frame mine = { 3, 4, 5 };
+ frame mine
+#if !DISABLE_WORK
+ = { 3, 4, 5 }
+#endif
+ ;
 
 #if REFERENCE_CLOSURE
     


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