debian man page for dispatch_benchmark

Query: dispatch_benchmark

OS: debian

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

dispatch_benchmark(3)					   BSD Library Functions Manual 				     dispatch_benchmark(3)

NAME
dispatch_benchmark -- Measures block execution time
SYNOPSIS
#include <dispatch/dispatch.h> uint64_t dispatch_benchmark(size_t count, void (^block)(void)); uint64_t dispatch_benchmark_f(size_t count, void *context, void (*function)(void *));
DESCRIPTION
The dispatch_benchmark() function executes the given block multiple times according to the count variable and then returns the average number of nanoseconds per execution. 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: o Code bound by computational bandwidth may be inferred by proportional changes in performance as concurrency is increased. o Code bound by memory bandwidth may be inferred by negligible changes in performance as concurrency is increased. o Code bound by critical sections may be inferred by retrograde changes in performance as concurrency is increased. o Intentional: locks, mutexes, and condition variables. o Accidental: unrelated and frequently modified data on the same cache-line.
RETURN VALUE
The dispatch_benchmark() function returns the average number of nanoseconds the given block takes to execute.
SEE ALSO
dispatch(3) Darwin May 1, 2009 Darwin
Related Man Pages
dispatch_apply(3) - mojave
dispatch_apply_f(3) - mojave
dispatch_benchmark(3) - debian
dispatch_apply(3) - osx
dispatch_apply_f(3) - osx
Similar Topics in the Unix Linux Community
Count not correct
Count the number of strings in a block
Calculating average with awk
Difference between concurrent and enhanced concurrent VG
Calculate the performance of employee