Skip to content

Reduce invalidation/recompliation for parser usage in sysimage#46

Merged
c42f merged 2 commits intomainfrom
c42f/core-hook-fixes
Aug 15, 2022
Merged

Reduce invalidation/recompliation for parser usage in sysimage#46
c42f merged 2 commits intomainfrom
c42f/core-hook-fixes

Conversation

@c42f
Copy link
Copy Markdown
Member

@c42f c42f commented Aug 15, 2022

  • Freeze world age by default in enable_in_core!()
  • Use a Ref to hide the invocation of the main hook function from the compiler

I don't understand why the use of the Ref (the second commit) seems necessary here; I would have thought that invoke_in_world should have done the job. But when I tested on Julia 1.7.3 without the Ref, loading the TerminalLoggers package caused significant latency on the next parse time.

Presumably the Ref breaks some extra backedges, though I'm not sure what they are or how best to debug the situation. (Perhaps SnoopCompile? I'd need to learn how to use that tooling.)

@c42f c42f force-pushed the c42f/core-hook-fixes branch from f82b6b5 to f6755f4 Compare August 15, 2022 04:05
c42f added 2 commits August 15, 2022 19:05
A fixed world age for the parser prevents the need for recompilation of
the parser due to any user-defined methods.
@c42f c42f force-pushed the c42f/core-hook-fixes branch from f6755f4 to 04a3dfd Compare August 15, 2022 09:20
@c42f c42f merged commit b1fa39e into main Aug 15, 2022
@c42f c42f deleted the c42f/core-hook-fixes branch August 15, 2022 23:34
@c42f
Copy link
Copy Markdown
Member Author

c42f commented Aug 15, 2022

This also seems to work in julia-1.9 dev, so let's go with it for now.

c42f added a commit to JuliaLang/julia that referenced this pull request Oct 17, 2025
…re-hook-fixes

Reduce invalidation/recompliation for parser usage in sysimage
topolarity pushed a commit to JuliaLang/julia that referenced this pull request Nov 14, 2025
…re-hook-fixes

Reduce invalidation/recompliation for parser usage in sysimage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant