Boost logo

Boost-Commit :

From: gpderetta_at_[hidden]
Date: 2008-03-21 11:08:32


Author: giovanni.deretta
Date: 2008-03-21 11:08:31 EDT (Fri, 21 Mar 2008)
New Revision: 43744
URL: http://svn.boost.org/trac/boost/changeset/43744

Log:
actually make the benchmark compilable
Text files modified:
   sandbox/SOC/2006/coroutine/trunk/libs/coroutine/benchmark/call_overhead.cpp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Modified: sandbox/SOC/2006/coroutine/trunk/libs/coroutine/benchmark/call_overhead.cpp
==============================================================================
--- sandbox/SOC/2006/coroutine/trunk/libs/coroutine/benchmark/call_overhead.cpp (original)
+++ sandbox/SOC/2006/coroutine/trunk/libs/coroutine/benchmark/call_overhead.cpp 2008-03-21 11:08:31 EDT (Fri, 21 Mar 2008)
@@ -98,7 +98,7 @@
 
 
 template<typename F>
-double test(F f, int n) {
+double test(F &f, int n) {
   int accum = 5;
   timer t;
   while(n--)
@@ -109,13 +109,14 @@
 
 int main() {
 
- int iterations = 1000*10*10*10*10;
-#if 0
+ int iterations = 1000*10*10*10*10*5;
+#if 1
   function_type function_foo(foo);
   function_type function_foo_struct = foo_struct();
   function_type function_ol_foo(ol_foo);
   coroutine_type coro_foo(foo_coro);
   foo_struct_coro t;
+ foo_struct foo_struct_;
   coroutine_type coro_foo_struct (t);
   coroutine_type coro_ol_foo(ol_foo_coro);
   cout.setf(ios_base::floatfield);
@@ -125,7 +126,7 @@
   cout << setw(50) << "Call to out-of-line function: "
        << setw(16) << right << test(ol_foo, iterations) << endl;
   cout << setw(50) << "Call to function object: "
- << setw(16) << right << test(foo_struct(), iterations) << endl;
+ << setw(16) << right << test(foo_struct_, iterations) << endl;
   cout << setw(50) << "Call to boost::function of function: "
        << setw(16) << right << test(function_foo, iterations) << endl;
   cout << setw(50) << "Call to boost::function of function object: "


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