refactor: Introduce MemoHeader to reduce monomorphization - #1142
Merged
MichaReiser merged 7 commits intoJun 23, 2026
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
MichaReiser
force-pushed
the
reduce-query-monomorphization
branch
3 times, most recently
from
June 19, 2026 06:22
b957339 to
5fedd09
Compare
MichaReiser
force-pushed
the
reduce-query-monomorphization
branch
11 times, most recently
from
June 20, 2026 12:58
21b4c44 to
baa2917
Compare
MemoHeader to reduce monomorphization
MichaReiser
force-pushed
the
reduce-query-monomorphization
branch
from
June 20, 2026 15:57
846dec5 to
cb5568c
Compare
MichaReiser
marked this pull request as ready for review
June 21, 2026 06:24
ibraheemdev
approved these changes
Jun 22, 2026
Member
There was a problem hiding this comment.
A further opportunity here is to mark Memo as repr(C), allowing you to safely treat a *const Memo<C> as *const MemoHeader, and avoid the monomorphization entirely in some of the helper methods, such as provisional_status, which still rely on looking up the concrete memo type in this PR. I was able to get much larger wins on that branch by extracting some of our query execution logic into state machines as well, but I think this PR is a good first step, and it makes sense to get most of the boilerplate out of the way before making more targeted changes.
MichaReiser
force-pushed
the
reduce-query-monomorphization
branch
from
June 23, 2026 07:09
22f1683 to
d980ece
Compare
MichaReiser
force-pushed
the
reduce-query-monomorphization
branch
from
June 23, 2026 07:41
d980ece to
9f5e215
Compare
MichaReiser
enabled auto-merge
June 23, 2026 07:45
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves configuration-independent memo validation and cycle metadata into
MemoHeaderto avoid monomorphization.This does not change the size of
MemobecauseMemoHeaderhas no padding (it's always 32 bytes).Release Binary size
LLVM IR
Testing: Passed local validation and GitHub CI.