ast: build the lowering context on first use - #63067
Open
levy wants to merge 1 commit into
Open
Conversation
levy
force-pushed
the
pr-ast-lazy-lowering-context
branch
from
September 8, 2026 08:48
fd96568 to
ce18535
Compare
`jl_init_flisp` loaded the flisp system image at every start. A program that never lowers an expression never needs it, and `jl_ast_ctx_enter` already builds a context when its free list is empty, so the eager call becomes the mutex initialization alone. `julia --startup-file=no -e ''`: 76.4 → 66.2 ms, minimum of 15 pinned runs. A REPL or a script lowers immediately and is unaffected; a compiled program gains the same 7 ms. Assisted-by: Claude Code (Opus 5)
levy
force-pushed
the
pr-ast-lazy-lowering-context
branch
from
September 8, 2026 11:57
ce18535 to
1b55205
Compare
This was referenced Sep 8, 2026
jl_init_flisp builds the lowering context at every start, and a compiled program never lowers
#63066
Open
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.
jl_init_flisploads the flisp system image at every start. A program that never lowers an expression never needs it, andjl_ast_ctx_enteralready builds a context when its free list is empty. The eager build becomes the mutex initialization alone, and the static context goes away.julia --startup-file=no -e '': 76.4 → 66.2 ms, minimum of 15 pinned runs (median 77.2 → 66.9). A script or a REPL lowers immediately and gains nothing; a compiled program gains the same 7 ms.The context is built inside
JL_SIGATOMIC_BEGIN, as the free-list path already did.syntax,metaandcorepass.Fixes #63066. Part of #63065.
Disclosure: developed with Claude Code (Opus 5) under my direction. It wrote the code and this text; the measurements were run on my machine. I reviewed the changes. The commits carry an
Assisted-bytrailer.