JvmPerformanceRunner

Shared synchronous execution; consumers describe operations rather than implementing sample loops.

Functions

Link copied to clipboard
fun <T : Any> measure(name: String, plan: PerformancePlan = PerformancePlan(), diagnosticsOwner: Any? = null, beforeSample: (Int) -> Unit = {}, afterSample: (Int) -> Unit = {}, afterOperation: (Int, T) -> Unit = { _, _ -> }, operation: (Int) -> T): PerformanceSample<T>

Runs warm-up, successful samples, and optional actual UI diagnostics on the caller's owner thread. Only the operation belongs to the timed interval; monitoring and serialization are separate. The last result is transferred to the caller and no earlier application result is retained.

Link copied to clipboard
fun sequence(iterations: Int, capacities: Map<String, Int>, operation: (Int, JvmPerformanceSequence) -> Unit): Map<String, JsonObject>

Runs declared interleaved operations and their setup without a downstream sampling engine. Failure propagates, incomplete intervals fail, and collector storage is released in either case.

Link copied to clipboard
fun warmup(count: Int, operation: (Int) -> Unit)

Runs untimed preparation operations before an application-owned fixture snapshot. Preparation and fixture snapshots remain outside the following measured interval.