Skip to content

Inline shard entry handling - #144

Merged
arthurprs merged 1 commit into
masterfrom
perf/inline-shard-entry
Nov 22, 2026
Merged

arthurprs merged 1 commit into
masterfrom
perf/inline-shard-entry

Conversation

@arthurprs

Copy link
Copy Markdown
Owner

Add #[inline] to CacheShard::entry_or_placeholder so LLVM can inline it into the sync entry path and the async poll path across codegen units. In the 16-unit integer build, this removes the shard call and lets LLVM branch on the result without passing the 40-byte EntryOrPlaceholder through a stack slot.

In local in-crate release runs on 124e88fd with Rust 1.95.0, repeatable integer sync::Cache::entry timings with two and four caller sites showed 5.4–7.1% lower hit latency (0.91–0.99 ns) and 5.7–7.4% lower miss latency (3.25–4.65 ns). With one codegen unit, the compiler already inlines the call and the hint produces identical linked text.

Validation on this branch used cargo +1.95.0 test --offline --locked --release with default features and with --features stats.

@arthurprs
arthurprs merged commit e3ff462 into master Nov 22, 2026
12 checks passed
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.

1 participant