Profiler Module For Manual Code Instrumentation
This module provides thread aware profiling at microsecond level
granularity with manually inserted code Instrumentation. You can
instrument a
block of code by wrapping it in Profiling.profile("any name you like").
For example, like this:
The result of the Profiling.profile call will be whatever the block returns
("example code" in this case).
You can print the results out with print_profile_data or log it with
log_profile_data. Once printed or logged, the data is reset and a new
capture starts. The printout is grouped by threads and nested
Profiling.profile calls are accounted for. Note that when profiling_enabled
is false, there is almost zero overhead. In particular, expressions
involving computing the argument to profile method will not be computed
because it is a functional by-name argument that is not evaluated if
profiling is disabled.
Profiler Module For Manual Code Instrumentation This module provides thread aware profiling at microsecond level granularity with manually inserted code Instrumentation. You can instrument a block of code by wrapping it in Profiling.profile("any name you like"). For example, like this:
The result of the Profiling.profile call will be whatever the block returns ("example code" in this case). You can print the results out with print_profile_data or log it with log_profile_data. Once printed or logged, the data is reset and a new capture starts. The printout is grouped by threads and nested Profiling.profile calls are accounted for. Note that when profiling_enabled is false, there is almost zero overhead. In particular, expressions involving computing the argument to profile method will not be computed because it is a functional by-name argument that is not evaluated if profiling is disabled.