perf: better cache sharing in isDefEq#8294
Closed
JovanGerb wants to merge 25 commits intoleanprover:masterfrom
Closed
perf: better cache sharing in isDefEq#8294JovanGerb wants to merge 25 commits intoleanprover:masterfrom
isDefEq#8294JovanGerb wants to merge 25 commits intoleanprover:masterfrom
Conversation
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 12, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 12, 2025
|
Mathlib CI status (docs):
|
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 12, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 12, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 12, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 12, 2025
mattrobball
reviewed
May 14, 2025
| if (← read).inTypeClassResolution then | ||
| -- See comment at `inTypeClassResolution` | ||
| pure (i == j && m == n) <&&> Meta.isExprDefEqAux t s | ||
| pure (i == j && m == n) <&&> checkpointDefEq (Meta.isExprDefEqAux t s) |
Contributor
There was a problem hiding this comment.
Curious about the effect of just these changes in isDefEqProj on Mathlib.
Contributor
Author
There was a problem hiding this comment.
I think just doing this change may cause a slight slowdown, because checkPointDefEq resets the transitive defEq cache. So the cache will be reset more often. I think it will work better as a fix done simultaneously with this the fix from this PR.
But I might be wrong, so feel free to try it.
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 14, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 14, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 14, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 14, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 15, 2025
3 tasks
…to the previous value
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 2, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 2, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 3, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 4, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 4, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 4, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 4, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 7, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 7, 2025
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 has moved to #8883
However, the effect of this change is better seen in mathlib, which has many complicated definitions, where the exponent in the exponential slowness can often get too big.
The mathlib benchmark shows
Zulip#lean4 > Exponential blowup in unification with metavariables @ 💬