Skip to content

benchmarks: add dedicated-consumer benchmarks for try_dequeue_from_producer#450

Merged
cameron314 merged 1 commit into
cameron314:masterfrom
benkier0:benchmarks/dedicated-consumer-dequeue
Apr 28, 2026
Merged

benchmarks: add dedicated-consumer benchmarks for try_dequeue_from_producer#450
cameron314 merged 1 commit into
cameron314:masterfrom
benkier0:benchmarks/dedicated-consumer-dequeue

Conversation

@benkier0

Copy link
Copy Markdown
Contributor

Adds benchmarks for try_dequeue_from_producer and try_dequeue_bulk_from_producer —
two hot paths that had zero coverage despite being the fastest dequeue paths in the API.

Each benchmark pairs N/2 producers with N/2 consumers 1:1 and runs both the dedicated
path and general try_dequeue side by side so the scan overhead is directly visible.

Results (Apple M-series, 64-bit):

N pairs try_dequeue Ops/s/t try_dequeue_from_producer Ops/s/t speedup
1 14.71M 15.33M 1.04x
2 2.76M 5.78M 2.09x
4 553.73k 2.39M 4.31x
8 121.12k 7.08M 58.5x

Note: the 16-thread "with tokens" result is higher than 8-thread — likely a scheduling
artifact from Apple Silicon's efficiency/performance core split.

Also relevant to #365.

@cameron314 cameron314 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this makes sense overall.

Comment thread benchmarks/benchmarks.cpp Outdated
@benkier0
benkier0 force-pushed the benchmarks/dedicated-consumer-dequeue branch from 2e83511 to 16cf73d Compare April 28, 2026 12:58
@cameron314
cameron314 merged commit d655418 into cameron314:master Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants