-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use PrecompileTools mechanics to compile REPL #55782
Merged
IanButterworth
merged 2 commits into
JuliaLang:master
from
IanButterworth:ib/repl_precompile_runtime
Sep 17, 2024
Merged
use PrecompileTools mechanics to compile REPL #55782
IanButterworth
merged 2 commits into
JuliaLang:master
from
IanButterworth:ib/repl_precompile_runtime
Sep 17, 2024
Conversation
This file contains 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
IanButterworth
force-pushed
the
ib/repl_precompile_runtime
branch
from
September 16, 2024 14:09
d1f1905
to
e4f5053
Compare
It would be good to know why there is still stuff left. Just to understand it. |
Using #55763. All but one are recompilation |
1 task
% ./julia --start=no -q -ie 'using SnoopCompileCore; tinv = @snoop_invalidations(begin using REPL; help_result(line, mod::Module=Base) = Core.eval(mod, REPL._helpmode(IOBuffer(), line, mod)); help_result("reinterpret") end)'
julia> using SnoopCompile, AbstractTrees
julia> trees = invalidation_trees(tinv)
15-element Vector{SnoopCompile.MethodInvalidations}:
inserting Core.Compiler.OptimizationParams(interp::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:566 invalidated:
inserting Core.Compiler.InferenceParams(interp::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:565 invalidated:
inserting get_inference_world(interp::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:567 invalidated:
inserting get_inference_cache(interp::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:568 invalidated:
inserting cache_owner(::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:569 invalidated:
inserting may_optimize(::REPL.REPLCompletions.REPLInterpreter) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:572 invalidated:
inserting bail_out_toplevel_call(::REPL.REPLCompletions.REPLInterpreter, ::Core.Compiler.InferenceLoopState, ::Core.Compiler.InferenceState) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:578 invalidated:
inserting const_prop_argument_heuristic(interp::REPL.REPLCompletions.REPLInterpreter, arginfo::Core.Compiler.ArgInfo, sv::Core.Compiler.InferenceState) @ REPL.REPLCompletions ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:676 invalidated:
inserting write(io::IO, c::Base.AnnotatedChar) @ StyledStrings ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/StyledStrings/src/io.jl:270 invalidated:
backedges: 1: superseding write(io::IO, x) @ Base io.jl:792 with MethodInstance for write(::IOBuffer, ::AbstractChar) (1 children)
3 mt_cache
inserting in(key_value::Pair, t::REPL.Terminals.TTYTerminal) @ REPL.Terminals ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/Terminals.jl:156 invalidated:
backedges: 1: superseding in(key_value::Pair, io::IO) @ Base show.jl:420 with MethodInstance for in(::Pair{Symbol, TypeVar}, ::IO) (1 children)
inserting display(d::REPL.REPLDisplay, x) @ REPL ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:503 invalidated:
mt_backedges: 1: signature Tuple{typeof(display), AbstractDisplay, Any} triggered MethodInstance for display(::Any) (0 children)
2: signature Tuple{typeof(display), AbstractDisplay, Any} triggered MethodInstance for Base.Multimedia.xdisplayable(::AbstractDisplay, ::Any) (1 children)
inserting haskey(t::REPL.Terminals.TTYTerminal, key) @ REPL.Terminals ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/Terminals.jl:157 invalidated:
backedges: 1: superseding haskey(io::IO, key) @ Base show.jl:422 with MethodInstance for haskey(::IO, ::Symbol) (2 children)
inserting displaysize(t::REPL.Terminals.UnixTerminal) @ REPL.Terminals ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/REPL/src/Terminals.jl:151 invalidated:
mt_backedges: 1: signature Tuple{typeof(displaysize), Any} triggered MethodInstance for (::Base.Precompilation.var"#74#75"{Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, String, Base.Precompilation.var"#ansi_moveup#58", Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Base.Precompilation.var"#color_string#38"{Bool}})() (0 children)
2: signature Tuple{typeof(displaysize), Any} triggered MethodInstance for (::Base.Precompilation.var"#76#77"{Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Base.Precompilation.MiniProgressBar, Vector{String}, Bool, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Set{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, String, Base.Event, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, String}, Vector{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}}, Int64, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Dict{Tuple{Base.PkgId, Pair{Cmd, Base.CacheFlags}}, Bool}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Base.Precompilation.var"#color_string#38"{Bool}})(::IOBuffer) (5 children)
backedges: 1: superseding displaysize(io::IO) @ Base stream.jl:568 with MethodInstance for displaysize(::IO) (26 children)
inserting kwcall(::NamedTuple, ::typeof(printstyled), io::Base.AnnotatedIOBuffer, msg...) @ StyledStrings.Legacy ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/StyledStrings/src/legacy.jl:126 invalidated:
backedges: 1: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol}, ::typeof(printstyled), ::IO, ::String, ::Any, ::String, ::Any, ::String) (1 children)
2: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Int64}, ::typeof(printstyled), ::IO, ::String) (2 children)
3: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Symbol}, ::typeof(printstyled), ::IO, ::Any, ::Symbol) (2 children)
4: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Int64}, ::typeof(printstyled), ::IO, ::Any, ::Symbol) (2 children)
5: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol, bold::Bool}, ::typeof(printstyled), ::IO, ::Module, ::Char) (2 children)
6: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol, bold::Bool}, ::typeof(printstyled), ::IO, ::String) (2 children)
7: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol, bold::Bool}, ::typeof(printstyled), ::IO, ::String, ::DataType, ::String) (2 children)
8: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol}, ::typeof(printstyled), ::IO, ::DataType) (2 children)
9: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol}, ::typeof(printstyled), ::IO, ::Type) (2 children)
10: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol}, ::typeof(printstyled), ::IO, ::String, ::Any, ::String) (2 children)
11: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol, underline::Bool}, ::typeof(printstyled), ::IO, ::String, ::String, ::Int32) (3 children)
12: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol}, ::typeof(printstyled), ::IO, ::String) (4 children)
13: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{color::Symbol, underline::Bool}, ::typeof(printstyled), ::IO, ::String, ::String, ::Int64) (6 children)
14: superseding kwcall(::NamedTuple, ::typeof(printstyled), io::IO, msg...) @ Base util.jl:141 with MethodInstance for Core.kwcall(::@NamedTuple{bold::Bool, italic::Bool, underline::Bool, blink::Bool, reverse::Bool, hidden::Bool, color::Symbol}, ::typeof(printstyled), ::IO, ::String) (91 children)
inserting print(io::IO, c::Base.AnnotatedChar) @ StyledStrings ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.12/StyledStrings/src/io.jl:281 invalidated:
backedges: 1: superseding print(io::IO, c::AbstractChar) @ Base char.jl:261 with MethodInstance for print(::IOBuffer, ::Base.AnnotatedChar{Char}) (40 children)
2: superseding print(io::IO, c::AbstractChar) @ Base char.jl:261 with MethodInstance for print(::IOContext{IOStream}, ::Base.AnnotatedChar{Char}) (82 children)
3: superseding print(io::IO, c::AbstractChar) @ Base char.jl:261 with MethodInstance for print(::IOContext{IOBuffer}, ::Base.AnnotatedChar{Char}) (309 children)
3 mt_cache |
timholy
approved these changes
Sep 17, 2024
IIRC, this is from the |
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.
Fixes #55778
Based on discussion here #55778 (comment)
With this
?reinterpret
feels instant, with only these precompiles at the start.