|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78617 - trunk/libs/context/performance
From: oliver.kowalke_at_[hidden]
Date: 2012-05-25 11:13:21
Author: olli
Date: 2012-05-25 11:13:20 EDT (Fri, 25 May 2012)
New Revision: 78617
URL: http://svn.boost.org/trac/boost/changeset/78617
Log:
context: conditiona compilation for rdtsc - performance tests
Text files modified:
trunk/libs/context/performance/cycle_i386.hpp | 2 ++
trunk/libs/context/performance/cycle_x86-64.hpp | 2 ++
trunk/libs/context/performance/performance.cpp | 4 ++++
3 files changed, 8 insertions(+), 0 deletions(-)
Modified: trunk/libs/context/performance/cycle_i386.hpp
==============================================================================
--- trunk/libs/context/performance/cycle_i386.hpp (original)
+++ trunk/libs/context/performance/cycle_i386.hpp 2012-05-25 11:13:20 EDT (Fri, 25 May 2012)
@@ -16,6 +16,8 @@
#include <boost/bind.hpp>
#include <boost/cstdint.hpp>
+#define BOOST_CONTEXT_CYCLE
+
typedef boost::uint64_t cycle_t;
#if _MSC_VER
Modified: trunk/libs/context/performance/cycle_x86-64.hpp
==============================================================================
--- trunk/libs/context/performance/cycle_x86-64.hpp (original)
+++ trunk/libs/context/performance/cycle_x86-64.hpp 2012-05-25 11:13:20 EDT (Fri, 25 May 2012)
@@ -16,6 +16,8 @@
#include <boost/bind.hpp>
#include <boost/cstdint.hpp>
+#define BOOST_CONTEXT_CYCLE
+
typedef boost::uint64_t cycle_t;
#if _MSC_VER >= 1400
Modified: trunk/libs/context/performance/performance.cpp
==============================================================================
--- trunk/libs/context/performance/performance.cpp (original)
+++ trunk/libs/context/performance/performance.cpp 2012-05-25 11:13:20 EDT (Fri, 25 May 2012)
@@ -66,6 +66,7 @@
ctx::jump_fcontext( & fc, & fcm, 7, preserve_fpu);
}
+#ifdef BOOST_CONTEXT_CYCLE
cycle_t test_function_cycle( cycle_t ov)
{
boost::function< void() > fn( boost::bind( f3) );
@@ -136,6 +137,7 @@
return total;
}
+#endif
#if _POSIX_C_SOURCE >= 199309L
zeit_t test_function_zeit( zeit_t ov)
@@ -235,6 +237,7 @@
}
bind_to_processor( 0);
+#ifdef BOOST_CONTEXT_CYCLE
{
cycle_t ov( overhead_cycles() );
std::cout << "overhead for rdtsc == " << ov << " cycles" << std::endl;
@@ -248,6 +251,7 @@
res = test_function_cycle( ov);
std::cout << "boost::function: average of " << res << " cycles per switch" << std::endl;
}
+#endif
#if _POSIX_C_SOURCE >= 199309L
{
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