GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DISPATCH_BENCHMARK (3)

NAME

dispatch_benchmark - Measures block execution time

CONTENTS

Synopsis
Description
Return Value
See Also

SYNOPSIS


.Fd #include <dispatch/dispatch.h> uint64_t
.Fo dispatch_benchmark size_t count void (^block)(void)
.Fc uint64_t
.Fo dispatch_benchmark_f size_t count void *context void (*function)(void *)
.Fc

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:

  • Code bound by computational bandwidth may be inferred by proportional changes in performance as concurrency is increased.
  • Code bound by memory bandwidth may be inferred by negligible changes in performance as concurrency is increased.
  • Code bound by critical sections may be inferred by retrograde changes in performance as concurrency is increased.
    • Intentional: locks, mutexes, and condition variables.
    • 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)
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.