The benchmarks page shows the timeout happy path (timeout never fires) allocating 168 B per call:
|
Kevlar |
Polly v8 |
Timeout(10 s) — completes instantly |
141 ns, 168 B |
127 ns, 0 B |
The cost is a fresh linked CancellationTokenSource + timer per execution. Polly pools its cancellation sources to get to 0 B. The same 168 B shows up in every composed pipeline containing a timeout (PipelineBenchmarks trio and five-strategy chain), so pooling the CTS would zero the allocation story for the most common production pipeline shape.
Benchmark: TimeoutBenchmarks.Kevlar_HappyPath in benchmarks/Kevlar.Benchmarks.
The benchmarks page shows the timeout happy path (timeout never fires) allocating 168 B per call:
Timeout(10 s)— completes instantlyThe cost is a fresh linked
CancellationTokenSource+ timer per execution. Polly pools its cancellation sources to get to 0 B. The same 168 B shows up in every composed pipeline containing a timeout (PipelineBenchmarkstrio and five-strategy chain), so pooling the CTS would zero the allocation story for the most common production pipeline shape.Benchmark:
TimeoutBenchmarks.Kevlar_HappyPathinbenchmarks/Kevlar.Benchmarks.