perf: use a cache in hasAssignableMVar#13036
Open
JovanGerb wants to merge 2 commits intoleanprover:masterfrom
Open
perf: use a cache in hasAssignableMVar#13036JovanGerb wants to merge 2 commits intoleanprover:masterfrom
hasAssignableMVar#13036JovanGerb wants to merge 2 commits intoleanprover:masterfrom
Conversation
Contributor
Author
|
!bench |
|
Benchmark results for 06073c5 against 90b5e31 are in. There are no significant changes. @JovanGerb
Medium changes (1✅)
Small changes (7✅, 1🟥)
|
Collaborator
|
Reference manual CI status:
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 22, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 22, 2026
Contributor
Author
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@e161197 against leanprover-community/mathlib4-nightly-testing@5a62ef1 are in. There are no significant changes. @JovanGerb
Medium changes (1🟥)
Small changes (2✅, 4🟥)
|
|
Mathlib CI status (docs):
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Mar 22, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Mar 22, 2026
Contributor
Author
|
!bench mathlib |
|
Benchmark results for leanprover-community/mathlib4-nightly-testing@8529154 against leanprover-community/mathlib4-nightly-testing@5a62ef1 are in. Significant changes detected! @JovanGerb
Large changes (4✅)
Medium changes (6✅)
Small changes (7✅, 1🟥)
|
|
Mathlib CI status (docs):
|
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.
This PR lets
hasAssignableMVartraverse the given expression with a cache, rather than traversing the expression entirely. This is an important performance fix, because the current slowest declaration in mathlib (inMathlib.Algebra.Category.ModuleCat.Stalk) spends more that half the time runninghasAssignableMVar.The mathlib speedup is
-332.4G (-0.19%)See also #13037