Which library implements which synchronization primitive, and which one measured fastest in a given benchmark run. A checkmark means that library has ever been benchmarked against that primitive (in any recorded run, on any platform); the highlighted ★ cell in each row is whichever ranked variant had the lowest mean time in the run selected below. A n/c ("non-competing") cell is an implementation shown for scale but left out of that comparison, because it lacks something the others in the row pay for on every call - a disposable releaser, a cancellation token, or being async at all.
Click a library to hide or show its column. Pooled, Nito.AsyncEx, ProtoPromise, RefImpl and System stay pinned leftmost and can't be hidden.
Data source: benchmark-history.sqlite, generated at build time from the run archive
on the benchmarks branch. "Fastest" is the arg-min of each variant's mean time in
the scenario closest to normal use - one contending party (not zero, and not a bare uncontended
call some benchmark classes also record) with a live, uncancelled token where one was measured
- rather than an average across every contention level and cancellation state: a "Multiple"
benchmark's mean time at high contention is the time for many concurrent operations, not a
per-operation cost, so blending it in would let whichever variant scales worst under load
dominate the result. It says nothing about variants never run on this platform, or about how
implementations compare under load - see the trends dashboard's
"Scaling by contention" view for that, and the speed differences
page for how far apart implementations typically land in this same representative scenario. Only
ranked variants are eligible for the ★; n/c cells (see below) are held
out. The raw baseline comparison table (Interlocked.*, lock(), SpinLock, SpinOnce) a
few benchmark classes measure alongside the real primitives isn't a synchronization primitive
itself and is excluded from this matrix.
n/c ("non-competing") marks a cell that is benchmarked and shown for scale but
excluded from the ★: the vendored RefImpl reference implementation (no cancellation,
no timeout, no pooling - it allocates per call); DotNext's AsyncExclusiveLock and
reader-writer lock in the lock rows (no disposable releaser, so it is measured doing less work
per operation); and "System" in the AutoResetEvent, ManualResetEvent, Barrier and
ReaderWriterLockSlim rows (a blocking wait, not an awaited one). Hover a cell for the specific
reason. It is the same idea as marking an entrant hors concours / ausser
Konkurrenz.
† marks a "System" cell whose primitive may have no true async wait API - its
benchmark measures a blocking wait rather than an awaited one, so the number is a baseline
reference rather than a fair race against the async implementations in the other columns. (Where
that is definitely the case, the cell is n/c instead.)
‡ marks "ProtoPromise" - it builds on its own Promise/Promise<T> type and
its own cancellation token rather than System.Threading.Tasks.ValueTask and
CancellationToken, so it is not drop-in compatible with code written against the
BCL types the other columns share.