libXDispatch 0.4
Functions
include/libdispatch/benchmark.h File Reference

Go to the source code of this file.

Functions

__DISPATCH_BEGIN_DECLS
DISPATCH_EXPORT
DISPATCH_NONNULL3
DISPATCH_NOTHROW uint64_t 
dispatch_benchmark_f (size_t count, void *ctxt, void(*func)(void *))

Function Documentation

__DISPATCH_BEGIN_DECLS DISPATCH_EXPORT DISPATCH_NONNULL3 DISPATCH_NOTHROW uint64_t dispatch_benchmark_f ( size_t  count,
void *  ctxt,
void(*)(void *)  func 
)

dispatch_benchmark

Count the average number of cycles a given block takes to execute.

Parameters:
countThe number of times to serially execute the given block.
blockThe block to execute.
Returns:
The approximate number of cycles the block takes to execute.

This function is for debugging and performance analysis work. For the best results, pass a high count value to dispatch_benchmark(). When benchmarking concurrent code, please compare the serial version of the code against the concurrent version, and compare the concurrent version on different classes of hardware. Please look for inflection points with various data sets and keep the following facts in mind:

1) Code bound by computational bandwidth may be inferred by proportional changes in performance as concurrency is increased. 2) Code bound by memory bandwidth may be inferred by negligible changes in performance as concurrency is increased. 3) Code bound by critical sections may be inferred by retrograde changes in performance as concurrency is increased. 3a) Intentional: locks, mutexes, and condition variables. 3b) Accidental: unrelated and frequently modified data on the same cache-line.


Generated on Wed Feb 22 2012 19:51:17 for libXDispatch by Doxygen 1.7.4
Content © 2011-2012 MLBA (about | privacy) – Design © 2010-2012 Emzeat. All Rights reserved.