|
template<class Measurements , class Event , class Executor , class Function >
requires BatchMeasurementPolicy<Measurements, Event> && std::invocable<Function&, std::size_t> |
| void | measure_batch (Measurements &measurements, Event event, std::size_t size, Executor &&executor, Function &&function) |
| | Execute a synchronous batch with compile-time-selected timing detail.
|
| |
template<class Measurements , class Event , class Function >
requires DurationMeasurementPolicy<Measurements, Event> && std::invocable<Function> |
| decltype(auto) | measure_duration (Measurements &measurements, Event event, Function &&function) |
| | Invoke a function with compile-time-gated wall-duration measurement.
|
| |
template<class Measurements , class Event , class Executor , class Function >
requires BatchMeasurementPolicy<Measurements, Event> && std::invocable<Function&, std::size_t>
| void uni20::performance::measure_batch |
( |
Measurements & |
measurements, |
|
|
Event |
event, |
|
|
std::size_t |
size, |
|
|
Executor && |
executor, |
|
|
Function && |
function |
|
) |
| |
Execute a synchronous batch with compile-time-selected timing detail.
The disabled policy invokes executor(function) directly. Coarse policies measure only the inclusive executor duration. Detailed policies additionally read the clock around each item, write one disjoint timing slot per index, and aggregate after the executor joins. A batch record is retained before an executor exception is rethrown.
- Precondition
- The executor invokes each started index at most once and does not return until all item invocations have joined.
- Template Parameters
-
| Measurements | Measurement policy type. |
| Event | Event identifier type. |
| Executor | Callable accepting the wrapped indexed item function. |
| Function | Callable accepting one index in [0, size). |
- Parameters
-
| measurements | Explicit measurement policy or collector. |
| event | Event identifying this batch. |
| size | Number of indexed work items. |
| executor | Synchronous scheduler or serial-loop adapter. |
| function | Work-item callable. |
template<class Measurements , class Event , class Function >
requires DurationMeasurementPolicy<Measurements, Event> && std::invocable<Function>
| decltype(auto) uni20::performance::measure_duration |
( |
Measurements & |
measurements, |
|
|
Event |
event, |
|
|
Function && |
function |
|
) |
| |
Invoke a function with compile-time-gated wall-duration measurement.
NoMeasurements instantiates only the direct invocation. Any other compatible policy reads the wall clock on entry and exit and records the elapsed duration, including when the function throws.
- Template Parameters
-
| Measurements | Measurement policy type. |
| Event | Event identifier type. |
| Function | Nullary callable type. |
- Parameters
-
| measurements | Explicit measurement policy or collector. |
| event | Event to record for an enabled collector. |
| function | Callable whose inclusive wall duration is measured. |
- Returns
- The callable result, preserving references and value category.