Repository navigation
perf: use .local asyncMode for eqnOptionsExt - #13477
Merged
Merged
Conversation
This PR fixes a benchmark regression introduced in #13475: `eqnOptionsExt` was using `.async .asyncEnv` asyncMode, which accumulates state in the `checked` environment and can block. Switching to `.local` — consistent with the neighbouring `eqnsExt` and the other declaration caches in `src/Lean/Meta` — restores performance (the `build/profile/blocked (unaccounted) wall-clock` bench moves from +33% back to baseline). `.local` is safe here because `saveEqnAffectingOptions` is only called during top-level `def` elaboration and downstream readers see the imported state; modifications on non-main branches are merged into the main branch on completion. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Collaborator
Author
|
!radar |
nomeata
enabled auto-merge
April 19, 2026 14:36
|
Benchmark results for 3cb5bd0 against 1d2cfb4 are in. There are significant results. @nomeata
Large changes (1✅)
Small changes (2✅)
|
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
nomeata
added a commit
that referenced
this pull request
Apr 21, 2026
This PR fixes a benchmark regression introduced in #13475: `eqnOptionsExt` was using `.async .asyncEnv` asyncMode, which accumulates state in the `checked` environment and can block. Switching to `.local` — consistent with the neighbouring `eqnsExt` and the other declaration caches in `src/Lean/Meta` — restores performance (the `build/profile/blocked (unaccounted) wall-clock` bench moves from +33% back to baseline). `.local` is safe here because `saveEqnAffectingOptions` is only called during top-level `def` elaboration and downstream readers see the imported state; modifications on non-main branches are merged into the main branch on completion. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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 fixes a benchmark regression introduced in #13475:
eqnOptionsExtwas using
.async .asyncEnvasyncMode, which accumulates state in thecheckedenvironment and can block. Switching to.local— consistentwith the neighbouring
eqnsExtand the other declaration caches insrc/Lean/Meta— restores performance (thebuild/profile/blocked (unaccounted) wall-clockbench moves from +33%back to baseline).
.localis safe here becausesaveEqnAffectingOptionsis only called during top-level
defelaboration and downstream readerssee the imported state; modifications on non-main branches are merged
into the main branch on completion.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]