XDispatch 0.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Functions
benchmark.h File Reference
#include <dispatch/base.h>

Go to the source code of this file.

Functions

uint64_t dispatch_benchmark (size_t count, void(^block)(void))
 Count the average number of cycles a given block takes to execute.
uint64_t dispatch_benchmark_f (size_t count, void *ctxt, void(*func)(void *))

Function Documentation

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

Count the average number of cycles a given 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.

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.
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 Sun Jan 27 2013 21:21:52 for XDispatch by Doxygen 1.7.6.1
© 2010-2013 MLBA (about | privacy) All Rights reserved.