XDispatch 0.6.1
Functions
benchmark.h File Reference
#include <dispatch/base.h>

Go to the source code of this file.

Functions

DISPATCH_NONNULL2
DISPATCH_NOTHROW uint64_t 
dispatch_benchmark (size_t count, void(^block)(void))
 dispatch_benchmark
DISPATCH_NONNULL3
DISPATCH_NOTHROW uint64_t 
dispatch_benchmark_f (size_t count, void *ctxt, void(*func)(void *))

Function Documentation

DISPATCH_NONNULL2 DISPATCH_NOTHROW uint64_t dispatch_benchmark ( size_t  count,
void(^)(void)  block 
)

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.

DISPATCH_NONNULL3 DISPATCH_NOTHROW uint64_t dispatch_benchmark_f ( size_t  count,
void *  ctxt,
void(*)(void *)  func 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Thu Apr 12 2012 09:50:43 for XDispatch by Doxygen 1.7.4
© 2010-2012 MLBA (about | privacy) All Rights reserved.