Skip to content

Split shallow_resolve into an inlinable fast path [-0.10% avg] - #103

Draft
xmakro wants to merge 1 commit into
perf/base-0809from
perf/rm0809-shallow
Draft

Split shallow_resolve into an inlinable fast path [-0.10% avg]#103
xmakro wants to merge 1 commit into
perf/base-0809from
perf/rm0809-shallow

Conversation

@xmakro

@xmakro xmakro commented Aug 10, 2026

Copy link
Copy Markdown
Owner

The overwhelmingly common case is a type that is not an inference variable, which can be answered by looking at the type kind. Keep that path tiny and inlinable at the many cross-crate call sites and push the actual variable resolution into a separate never-inlined function.

Measured alone at head 969b803 (clean from-scratch ThinLTO plus jemalloc stage2 build per side, instructions:u, Check/Debug/Opt across Full/IncrFull/IncrUnchanged/IncrPatched, 551 cells): -0.10% mean, 70 cells improved by at least 0.25%, 1 regressed. Top cells: projection-caching check full -1.13%, deeply-nested-multi check full -0.90%, unify-linearly check full -0.81%.

Caveat: this is an inlining change rather than work removal, and the local proxy has no PGO or BOLT, so the collector may credit inlining that a dist build would already have done. Expect the upstream number to come in under the local one.

The overwhelmingly common case is a type that is not an inference
variable, which can be answered by looking at the kind. Keep that path
tiny and inlinable at the many cross-crate call sites and push variable
resolution into a separate never-inlined function.
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