|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51598 - sandbox/reference_closure
From: dave_at_[hidden]
Date: 2009-03-03 23:01:09
Author: dave
Date: 2009-03-03 23:01:09 EST (Tue, 03 Mar 2009)
New Revision: 51598
URL: http://svn.boost.org/trac/boost/changeset/51598
Log:
do some work in the callback
Text files modified:
sandbox/reference_closure/timings.txt | 15 +++++++++++++++
sandbox/reference_closure/trivial_closure.h | 5 +++--
sandbox/reference_closure/trivial_initiator.h | 2 +-
3 files changed, 19 insertions(+), 3 deletions(-)
Modified: sandbox/reference_closure/timings.txt
==============================================================================
--- sandbox/reference_closure/timings.txt (original)
+++ sandbox/reference_closure/timings.txt 2009-03-03 23:01:09 EST (Tue, 03 Mar 2009)
@@ -54,3 +54,18 @@
t(std::function<>) / t(reference_closure): 4.1
+=== Do Some Work in the Callback ===
+
+execute refclosure
+real 0m1.467s
+user 0m1.463s
+sys 0m0.003s
+
+execute stdfunction
+real 0m4.710s
+user 0m4.700s
+sys 0m0.008s
+
+t(std::function<>) / t(reference_closure): 3.2
+
+
Modified: sandbox/reference_closure/trivial_closure.h
==============================================================================
--- sandbox/reference_closure/trivial_closure.h (original)
+++ sandbox/reference_closure/trivial_closure.h 2009-03-03 23:01:09 EST (Tue, 03 Mar 2009)
@@ -1,10 +1,11 @@
#ifndef TRIVIAL_CLOSURE2_DWA200933_H
# define TRIVIAL_CLOSURE2_DWA200933_H
-struct frame { };
+struct frame { double a, b, c; };
-inline void work( frame* )
+inline void work( frame* f )
{
+ f->a += f->b * f->c;
}
#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-03 23:01:09 EST (Tue, 03 Mar 2009)
@@ -2,7 +2,7 @@
#include "parallel_lib.h"
void initiator() {
- frame mine;
+ frame mine = { 3, 4, 5 };
#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