Skip to content
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

Startup time regression on master vs 1.5 #36391

Closed
KristofferC opened this issue Jun 23, 2020 · 4 comments · Fixed by #36451
Closed

Startup time regression on master vs 1.5 #36391

KristofferC opened this issue Jun 23, 2020 · 4 comments · Fixed by #36451
Assignees
Labels
compiler:latency Compiler latency regression Regression in behavior compared to a previous version
Milestone

Comments

@KristofferC
Copy link
Member

KristofferC commented Jun 23, 2020

Starting 1.5/1.4 with --trace-compile=stderr gives the following:

❯ julia --trace-compile=stderr -q
precompile(Tuple{typeof(REPL.Terminals.hascolor), REPL.Terminals.TTYTerminal})
precompile(Tuple{Type{Base.Dict{Symbol, Any}}, Base.Pair{Symbol, REPL.LineEdit.Prompt}, Vararg{Base.Pair{Symbol, REPL.LineEdit.Prompt}, N} where N})
precompile(Tuple{typeof(Base.peek), Base.IOStream})
precompile(Tuple{Type{Char}, Int32})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#45#76"))}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#74#105")){REPL.LineEdit.HistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#49#58")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#251#255")){REPL.LineEdit.PrefixHistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#39#42")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.UnixTerminal, Any})
julia>

So here we have a good accuracy in precompilation of startup and REPL initialization (most compilation are Vararg methods that seem to not precompile)

However, on master:

❯ ./julia --trace-compile=stderr -q
precompile(Tuple{typeof(Base.Filesystem.abspath), String, String, Vararg{String, N} where N})
precompile(Tuple{Type{Base.VersionNumber}, UInt32, UInt32, UInt32, Tuple{}, Tuple{}})
precompile(Tuple{Type{Base.Multimedia.TextDisplay}, Base.TTY})
precompile(Tuple{Type{Logging.ConsoleLogger}, Base.TTY})
precompile(Tuple{typeof(Base.getproperty), Base.CoreLogging.LogState, Symbol})
precompile(Tuple{Type{Base.VersionNumber}, Int32, Int32, Int32})
precompile(Tuple{Type{REPL.Terminals.TTYTerminal}, String, Base.TTY, Base.TTY, Base.TTY})
precompile(Tuple{typeof(REPL.Terminals.hascolor), REPL.Terminals.TTYTerminal})
precompile(Tuple{typeof(Base.get), Base.TTY, Symbol, Bool})
precompile(Tuple{typeof(Base.getproperty), REPL.Terminals.TTYTerminal, Symbol})
precompile(Tuple{typeof(Base.getindex), Base.Dict{Union{Int64, Symbol}, String}, Symbol})
precompile(Tuple{typeof(Base.convert), Type{REPL.Terminals.TextTerminal}, REPL.Terminals.TTYTerminal})
precompile(Tuple{typeof(Base.convert), Type{Bool}, Bool})
precompile(Tuple{Type{REPL.REPLDisplay{R} where R<:REPL.AbstractREPL}, REPL.LineEditREPL})
precompile(Tuple{typeof(Base.Multimedia.pushdisplay), REPL.REPLDisplay{REPL.LineEditREPL}})
precompile(Tuple{getfield(Pkg, Symbol("#1#2")), REPL.LineEditREPL})
precompile(Tuple{Type{NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_enter), T} where T<:Tuple}, Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, typeof(REPL.return_callback)}})
precompile(Tuple{typeof(Base.haskey), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_enter), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, typeof(REPL.return_callback)}}, Symbol})
precompile(Tuple{typeof(Base.getindex), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_enter), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, typeof(REPL.return_callback)}}, Symbol})
precompile(Tuple{typeof(Base.isempty), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}})
precompile(Tuple{Type{NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), T} where T<:Tuple}, Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#62#72")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}})
precompile(Tuple{typeof(Base.haskey), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#62#72")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}}, Symbol})
precompile(Tuple{typeof(Base.getindex), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.REPLCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#62#72")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}}, Symbol})
precompile(Tuple{Type{NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), T} where T<:Tuple}, Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.ShellCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#63#73")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}})
precompile(Tuple{typeof(Base.haskey), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.ShellCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#63#73")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}}, Symbol})
precompile(Tuple{typeof(Base.getindex), NamedTuple{(:prompt_prefix, :prompt_suffix, :repl, :complete, :on_done), Tuple{String, typeof(Base.input_color), REPL.LineEditREPL, REPL.ShellCompletionProvider, getfield(REPL, Symbol("#do_respond#54")){Bool, Bool, getfield(REPL, Symbol("#63#73")){REPL.LineEditREPL}, REPL.LineEditREPL, REPL.LineEdit.Prompt}}}, Symbol})
precompile(Tuple{Type{Base.Dict{Symbol, Any}}, Base.Pair{Symbol, REPL.LineEdit.Prompt}, Vararg{Base.Pair{Symbol, REPL.LineEdit.Prompt}, N} where N})
precompile(Tuple{Type{REPL.REPLHistoryProvider}, Any, Any, Any, Any, Any, Any, Any, Any, Any})
precompile(Tuple{typeof(Base.convert), Type{Array{String, 1}}, Array{String, 1}})
precompile(Tuple{typeof(Base.convert), Type{Int64}, Int64})
precompile(Tuple{typeof(Base.convert), Type{Base.Dict{K, V} where V where K}, Base.Dict{Symbol, Any}})
precompile(Tuple{typeof(Base.convert), Type{Array{Symbol, 1}}, Array{UInt8, 1}})
precompile(Tuple{typeof(Base.convert), Type{Union{Nothing, IO}}, Base.IOStream})
precompile(Tuple{typeof(Base.seek), Base.IOStream, Int64})
precompile(Tuple{typeof(Base.eof), Base.IOStream})
precompile(Tuple{typeof(Base.:(!=)), Char, Char})
precompile(Tuple{typeof(Base.getproperty), REPL.REPLHistoryProvider, Symbol})
precompile(Tuple{typeof(Base.push!), Array{Symbol, 1}, Symbol})
precompile(Tuple{typeof(Base.push!), Array{String, 1}, String})
precompile(Tuple{typeof(Base.seekend), Base.IOStream})
precompile(Tuple{typeof(Base.length), Array{String, 1}})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#45#76"))}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{typeof(Base.isequal), String, String})
precompile(Tuple{typeof(Base.isequal), String, Char})
precompile(Tuple{typeof(Base._iterate), Base.Dict{Any, Any}, Int64})
precompile(Tuple{typeof(Base.:(<=)), Int64, Int64})
precompile(Tuple{typeof(Base.iterate), String, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Char, Int64}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Char, Int64}, Int64, Int64})
precompile(Tuple{typeof(Base.hashindex), String, Int64})
precompile(Tuple{typeof(Base.:(-)), Char, Int64})
precompile(Tuple{Type{Char}, Int64})
precompile(Tuple{typeof(Base.iterate), Array{Base.Dict{Any, Any}, 1}})
precompile(Tuple{typeof(Base.copy), Base.Dict{Char, Any}})
precompile(Tuple{typeof(Base.keys), Base.Dict{Any, Any}})
precompile(Tuple{typeof(Base.iterate), Base.KeySet{Any, Base.Dict{Any, Any}}})
precompile(Tuple{typeof(Base.getindex), Base.Dict{Any, Any}, String})
precompile(Tuple{typeof(Base.haskey), NamedTuple{(:override,), Tuple{Bool}}, Symbol})
precompile(Tuple{typeof(Base.getindex), NamedTuple{(:override,), Tuple{Bool}}, Symbol})
precompile(Tuple{typeof(Base.iterate), String})
precompile(Tuple{typeof(Base.iterate), Base.KeySet{Any, Base.Dict{Any, Any}}, Int64})
precompile(Tuple{typeof(Base.keys), Base.Dict{Char, Any}})
precompile(Tuple{typeof(Base.in), Char, Base.KeySet{Char, Base.Dict{Char, Any}}})
precompile(Tuple{typeof(Base.getindex), Base.Dict{Char, Any}, Char})
precompile(Tuple{typeof(Base.setdiff), Base.KeySet{Any, Base.Dict{Any, Any}}, Base.KeySet{Any, Base.Dict{Any, Any}}})
precompile(Tuple{typeof(Base.push!), Base.Set{Any}, String})
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, String})
precompile(Tuple{typeof(Base.iterate), Base.Set{Any}})
precompile(Tuple{typeof(Base.iterate), Array{Base.Dict{Any, Any}, 1}, Int64})
precompile(Tuple{typeof(Base.haskey), Base.Dict{Any, Any}, String})
precompile(Tuple{typeof(Base.iterate), Base.Set{Any}, Int64})
precompile(Tuple{typeof(Base.haskey), Base.Dict{Char, Any}, Char})
precompile(Tuple{typeof(Base._iterate), Base.Dict{Char, Any}, Int64})
precompile(Tuple{typeof(Base.iterate), Base.KeySet{Char, Base.Dict{Char, Any}}})
precompile(Tuple{typeof(Base.:(>)), Int64, Int64})
precompile(Tuple{typeof(Base.values), Base.Dict{Char, Any}})
precompile(Tuple{typeof(Base.iterate), Base.ValueIterator{Base.Dict{Char, Any}}})
precompile(Tuple{typeof(Base.iterate), Base.ValueIterator{Base.Dict{Char, Any}}, Int64})
precompile(Tuple{typeof(Base.iterate), Base.KeySet{Char, Base.Dict{Char, Any}}, Int64})
precompile(Tuple{typeof(Base.iterate), Char})
precompile(Tuple{typeof(Base.iterate), Char, Bool})
precompile(Tuple{typeof(Base.:(==)), Char, String})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#74#105")){REPL.LineEdit.HistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#66#76")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{String, getfield(REPL.LineEdit, Symbol("#251#255")){REPL.LineEdit.PrefixHistoryPrompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{typeof(Base.prepend!), Array{Base.Dict{Any, Any}, 1}, Array{Base.Dict{Any, Any}, 1}})
precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Char, getfield(REPL, Symbol("#55#58")){REPL.LineEdit.Prompt}}, Vararg{Base.Pair{A, B} where B where A, N} where N})
precompile(Tuple{typeof(Base.getproperty), REPL.LineEditREPL, Symbol})
precompile(Tuple{typeof(Base.getproperty), REPL.LineEdit.ModalInterface, Symbol})
precompile(Tuple{typeof(Base.iterate), Array{REPL.LineEdit.TextInterface, 1}})
precompile(Tuple{typeof(Base.iterate), Array{REPL.LineEdit.TextInterface, 1}, Int64})
precompile(Tuple{typeof(Base.getindex), Base.Dict{Any, Any}, Char})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Char, Bool}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Char, Bool}, Int64, Int64})
precompile(Tuple{typeof(Base.push!), Base.Set{Any}, Char})
precompile(Tuple{typeof(Base.delete!), Base.Set{Any}, Char})
precompile(Tuple{typeof(Base.convert), Type{Base.Dict{Char, V} where V}, Base.Dict{Char, Any}})
precompile(Tuple{typeof(REPL.run_repl), REPL.AbstractREPL, Any})
precompile(Tuple{getfield(Base, Symbol("#836#838")), REPL.REPLBackend})
precompile(Tuple{typeof(Base.take!), Base.Channel{Any}})
precompile(Tuple{getfield(REPL, Symbol("#38#42")){REPL.LineEditREPL, REPL.REPLBackendRef}})
precompile(Tuple{typeof(Base.:(==)), Base.Multimedia.TextDisplay, REPL.REPLDisplay{REPL.LineEditREPL}})
precompile(Tuple{typeof(Base.:(==)), REPL.REPLDisplay{R} where R<:REPL.AbstractREPL, REPL.REPLDisplay{R} where R<:REPL.AbstractREPL})
precompile(Tuple{Type{REPL.LineEdit.PromptState}, REPL.Terminals.AbstractTerminal, REPL.LineEdit.Prompt, Base.GenericIOBuffer{Array{UInt8, 1}}, Symbol, Array{Base.GenericIOBuffer{Array{UInt8, 1}}, 1}, Int64, REPL.LineEdit.InputAreaState, Int64, Base.AbstractLock, Float64, Float64})
precompile(Tuple{typeof(REPL.LineEdit.init_state), Any, REPL.LineEdit.HistoryPrompt})
precompile(Tuple{typeof(Base.convert), Type{REPL.Terminals.AbstractTerminal}, REPL.Terminals.TTYTerminal})
precompile(Tuple{typeof(REPL.LineEdit.init_state), Any, REPL.LineEdit.PrefixHistoryPrompt})
precompile(Tuple{typeof(Base.check_open), Base.TTY})
precompile(Tuple{typeof(Base.getproperty), Base.TTY, Symbol})
precompile(Tuple{typeof(Base.unsafe_convert), Type{Ptr{Nothing}}, Ptr{Nothing}})
precompile(Tuple{typeof(Base.write), Base.TTY, String})
precompile(Tuple{typeof(Base.convert), Type{REPL.LineEdit.InputAreaState}, REPL.LineEdit.InputAreaState})
precompile(Tuple{typeof(REPL.LineEdit.refresh_multi_line), REPL.Terminals.UnixTerminal, Any})
precompile(Tuple{Type{NamedTuple{(:indent, :region_active), T} where T<:Tuple}, Tuple{Int64, Bool}})
precompile(Tuple{typeof(Base.haskey), NamedTuple{(:indent, :region_active), Tuple{Int64, Bool}}, Symbol})
precompile(Tuple{typeof(Base.getindex), NamedTuple{(:indent, :region_active), Tuple{Int64, Bool}}, Symbol})
precompile(Tuple{typeof(Base.write), Base.GenericIOBuffer{Array{UInt8, 1}}, String})
precompile(Tuple{typeof(REPL.LineEdit.write_prompt), Any, REPL.LineEdit.PromptState})
precompile(Tuple{typeof(REPL.LineEdit.prompt_string), Function})
precompile(Tuple{typeof(Base.write), REPL.Terminals.TerminalBuffer, String})
precompile(Tuple{typeof(REPL.LineEdit.prompt_string), AbstractString})
precompile(Tuple{typeof(Base.Unicode.textwidth), String})
precompile(Tuple{typeof(Base.divrem), Int64, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Int64, Int64}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Int64, Int64}, Int64, Int64})
precompile(Tuple{typeof(Base.:(+)), Int64, Bool})
precompile(Tuple{typeof(Base.max), Int64, Int64})
precompile(Tuple{typeof(Base.div), Int64, Int64})
precompile(Tuple{typeof(Base.:(>=)), Int64, Int64})
precompile(Tuple{typeof(Base.write), REPL.Terminals.TTYTerminal, Array{UInt8, 1}})
precompile(Tuple{typeof(REPL.LineEdit.terminal), REPL.LineEdit.PromptState})
precompile(Tuple{typeof(Base.eof), Base.TTY})
precompile(Tuple{typeof(Base.leading_ones), UInt8})
precompile(Tuple{typeof(Base.:(*)), Int64, Int64})
precompile(Tuple{Type{UInt32}, UInt8})
precompile(Tuple{typeof(Base.:(<<)), UInt32, Int64})
precompile(Tuple{typeof(Base.reinterpret), Type{Char}, UInt32})
precompile(Tuple{typeof(Base.push!), Array{Char, 1}, Char})
precompile(Tuple{typeof(Base.get), Base.Dict{Char, Any}, Char, Nothing})
precompile(Tuple{typeof(Base.convert), Type{Array{Char, 1}}, Array{Char, 1}})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("#22#23")){getfield(REPL.LineEdit, Symbol("#113#166")), String}, Any, Any})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("#113#166")), Any, Any, Vararg{Any, N} where N})
precompile(Tuple{typeof(REPL.LineEdit.buffer), REPL.LineEdit.PromptState})
precompile(Tuple{typeof(Base.getproperty), Base.GenericIOBuffer{Array{UInt8, 1}}, Symbol})
precompile(Tuple{typeof(Base.getproperty), REPL.Options, Symbol})
precompile(Tuple{typeof(REPL.LineEdit.edit_abort), Any, Bool})
precompile(Tuple{getfield(REPL.LineEdit, Symbol("##edit_abort#108")), Any, typeof(REPL.LineEdit.edit_abort), Any, Bool})
precompile(Tuple{typeof(Base.println), REPL.Terminals.TTYTerminal})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Base.GenericIOBuffer{Array{UInt8, 1}}, Bool, Bool}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Base.GenericIOBuffer{Array{UInt8, 1}}, Bool, Bool}, Int64, Int64})
precompile(Tuple{typeof(REPL.LineEdit.mode), REPL.LineEdit.PromptState})
precompile(Tuple{typeof(Base.getproperty), REPL.LineEdit.Prompt, Symbol})
precompile(Tuple{typeof(Base.put!), Base.Channel{Any}, Tuple{Nothing, Int64}})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Nothing, Int64}, Int64})
precompile(Tuple{typeof(Base.indexed_iterate), Tuple{Nothing, Int64}, Int64, Int64})
precompile(Tuple{getfield(Base, Symbol("#742#743"))})
precompile(Tuple{getfield(REPL, Symbol("#64#74")){Base.IOStream}, Any})
julia>

This has the effect that startup time is increased (50ms to 100ms for me) but the major regression is the time until the REPL prompt (which isn't trivial to measure exactly).

@KristofferC KristofferC added regression Regression in behavior compared to a previous version compiler:latency Compiler latency labels Jun 23, 2020
@KristofferC KristofferC added this to the 1.6 milestone Jun 23, 2020
@KristofferC
Copy link
Member Author

Bisect blames be77eb8

cc @vtjnash

@vtjnash
Copy link
Member

vtjnash commented Jun 23, 2020

which isn't trivial to measure exactly

It's just user time (and ignore real):

$ time ./julia --st=no --hi=no -q
julia> ^D

real	---
user	0m0.748s
sys	0m0.107s

@KristofferC
Copy link
Member Author

Thanks, it seems to be about 200 ms extra for REPL init then.

@timholy
Copy link
Member

timholy commented Jun 23, 2020

Some of those are pretty hard to believe (not doubting you, I can reproduce what you're seeing). precompile(Tuple{typeof(Base.:(<=)), Int64, Int64}) and precompile(Tuple{typeof(Base.:(>)), Int64, Int64}), you seriously expect me to believe these have never been compiled? precompile(Tuple{typeof(Base.:(*)), Int64, Int64})??

Smells like invalidation. With this diff:

diff --git a/base/Base.jl b/base/Base.jl
index 777e07bd30..88f16161ab 100644
--- a/base/Base.jl
+++ b/base/Base.jl
@@ -74,6 +74,8 @@ include("generator.jl")
 include("reflection.jl")
 include("options.jl")
 
+const _invlist_ = ccall(:jl_debug_method_invalidation, Any, (Cint,), Int32(1))
+
 # core operations & types
 include("promotion.jl")
 include("tuple.jl")

you can turn on logging early. Then (you need timholy/SnoopCompile.jl#101)

julia> Base._invlist_
6688-element Array{Any,1}:
  MethodInstance for unsafe_getindex(::Core.Compiler.StepRangeLen{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},R,S} where S where R, ::Int64)
 0
  MethodInstance for iterate(::Core.Compiler.StepRangeLen{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},R,S} where S where R, ::Int64)
 1
  MethodInstance for iterate(::Union{Core.Compiler.LinRange{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode}}, Core.Compiler.StepRangeLen{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},R,S} where S where R})
 2
  MethodInstance for vcat(::Core.Compiler.AbstractRange{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode}})
 3
  MethodInstance for Array{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},1}(::Core.Compiler.AbstractRange{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode}})
 4
  MethodInstance for convert(::Type{Array{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},1}}, ::AbstractArray)
 5
  MethodInstance for Core.Compiler.Pair{Int64,Array{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},1}}(::Any, ::Any)
 6
  Tuple{Type{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode}},Any}
  (::Type{T})(x::Tuple) where T<:Tuple in Base at tuple.jl:225
  "jl_method_table_insert"
  MethodInstance for convert(::Type{T}, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) where T<:(Array{T,1} where T)
 0
  MethodInstance for Core.Compiler.Order.Perm{Core.Compiler.Sort.Float.Left,V}(::Core.Compiler.Sort.Float.Left, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) where V<:(AbstractArray{T,1} where T)
 1
  MethodInstance for Core.Compiler.Order.Perm(::Core.Compiler.Sort.Float.Left, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64})
 2
  MethodInstance for left(::Core.Compiler.Order.Perm{var"#s116",var"#s115"} where var"#s115"<:(Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) where var"#s116"<:Union{Core.Compiler.Order.ForwardOrdering, Core.Compiler.Order.ReverseOrdering{Core.Compiler.Order.ForwardOrdering}})
 
  MethodInstance for axes(::Array{Int64,1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{NamedTuple{(:indent, :msg),Tuple{Int64,SubString{String}}},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{UInt8,1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Union{Nothing, Symbol},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{SubString{String},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Array{Any,1},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Pair{Symbol,Any},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Pair{String,Array{Array{Pair{Symbol,Any},1},1}},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Union{Nothing, SubString{String}},1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Pkg.REPLMode.CommandSpec,1})
  "invalidate_mt_cache"
  MethodInstance for axes(::Array{Pair{String,Pkg.REPLMode.CommandSpec},1})
  "invalidate_mt_cache"
  MethodInstance for length(::SubArray{UInt8,1,Array{UInt8,1},Tuple{UnitRange{Int64}},true})
  "invalidate_mt_cache"

julia> using SnoopCompile

julia> trees = invalidation_trees(Base._invlist_)
55-element Array{SnoopCompileAnalysis.MethodInvalidations,1}:
 inserting lastindex(a::AbstractArray) in Base at abstractarray.jl:302 invalidated:
   mt_backedges: 1: signature Tuple{typeof(lastindex),Array{Any,1}} triggered MethodInstance for pushmeta!(::Expr, ::Symbol) (0 children) less specific

 inserting String(s::AbstractString) in Base at strings/string.jl:81 invalidated:
   mt_backedges: 1: signature Tuple{Type{String},AbstractString} triggered MethodInstance for cconvert(::Type{Ptr{UInt8}}, ::AbstractString) (0 children) equal specificity
   4 mt_cache

 inserting to_indices(A, I::Tuple{}) in Base at multidimensional.jl:704 invalidated:
   mt_backedges: 1: signature Tuple{typeof(to_indices),Any,Any} triggered MethodInstance for _maybe_reindex(::SubArray, ::Tuple{UnitRange{Int64}}, ::Tuple{}) (0 children) more specific

 inserting fill!(A::AbstractArray{T,N} where N, x) where T in Base at multidimensional.jl:965 invalidated:
   mt_backedges: 1: signature Tuple{typeof(fill!),SubArray,Type{StridedArray{_A, _B}} where _B where _A} triggered MethodInstance for __cat(::Array{_A,1} where _A, ::Tuple{Int64}, ::Tuple{Bool}, ::Type{StridedArray{_A, _B}} where _B where _A, ::Array{Any,1}) (0 children) less specific

 inserting isless(::Missing, ::Any) in Base at missing.jl:87 invalidated:
   mt_backedges: 1: signature Tuple{typeof(isless),Any,Char} triggered MethodInstance for <(::Any, ::Char) (0 children) ambiguous

 inserting isless(::Any, ::Missing) in Base at missing.jl:88 invalidated:
   mt_backedges: 1: signature Tuple{typeof(isless),Char,Any} triggered MethodInstance for <(::Char, ::Any) (0 children) ambiguous

 inserting typemax(::Type{VersionNumber}) in Base at version.jl:142 invalidated:
   mt_backedges: 1: signature Tuple{typeof(typemax),Type{VersionNumber}} triggered MethodInstance for VersionNumber(::String) (0 children) equal specificity
   14 mt_cache

 inserting (::Base.var"#string##kw")(::Any, ::typeof(string), n::BigInt) in Base.GMP at gmp.jl:681 invalidated:
   mt_backedges: 1: signature Tuple{Base.var"#string##kw",NamedTuple{(:base, :pad),Tuple{Int64,Int64}},typeof(string),Any} triggered MethodInstance for escape_string(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::AbstractString, ::String) (0 children) ambiguous
   122 mt_cache

 deleting include(path::String) in Base at Base.jl:17 invalidated:
   1 mt_cache

 inserting convert(::Type{T}, f::LinearAlgebra.Factorization) where T<:AbstractArray in LinearAlgebra at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:58 invalidated:
   mt_backedges: 1: signature Tuple{typeof(convert),Type{UnitRange{Int64}},Any} triggered MethodInstance for setindex!(::Array{UnitRange{Int64},1}, ::Any, ::Int64) (0 children) ambiguous
   704 mt_cache

 inserting convert(::Type{T}, x::T) where T<:Number in Base at number.jl:6 invalidated:
   mt_backedges: 1: signature Tuple{typeof(convert),Type{T} where T,Int32} triggered MethodInstance for cconvert(::Type{T} where T, ::Int32) (0 children) ambiguous
   backedges: 1: superseding convert(::Type{T}, x::T) where T in Base at essentials.jl:171 with MethodInstance for convert(::Type{T}, ::T) where T<:Int32 (1 children) more specific

 inserting convert(::Type{T}, x::Number) where T<:Number in Base at number.jl:7 invalidated:
   backedges: 1: superseding convert(::Type{Union{}}, x) in Base at essentials.jl:169 with MethodInstance for convert(::Type{Union{}}, ::Int32) (1 children) ambiguous

 inserting Array{T,N}(x::AbstractArray{S,N}) where {T, N, S} in Base at array.jl:564 invalidated:
   mt_backedges: 1: signature Tuple{Type{Array{_A,1}} where _A,Array{S,1} where S<:Union{Float32, Float64}} triggered MethodInstance for (Array{T,1} where T)(::Array{S,1}) where S<:Union{Float32, Float64} (1 children) less specific
   4 mt_cache

 inserting Array{T,1}(::UndefInitializer, m::Integer) where T in Base at baseext.jl:12 invalidated:
   mt_backedges: 1: signature Tuple{Type{Array{Core.LineInfoNode,1}},UndefInitializer,Any} triggered MethodInstance for analyze_method!(::Int64, ::Core.Compiler.Signature, ::Any, ::Core.SimpleVector, ::Method, ::Expr, ::Core.Compiler.OptimizationState, ::Bool, ::Core.Compiler.InvokeData, ::Any) (0 children) ambiguous
                 2: signature Tuple{Type{Array{Core.LineInfoNode,1}},UndefInitializer,Any} triggered MethodInstance for analyze_method!(::Int64, ::Core.Compiler.Signature, ::Any, ::Core.SimpleVector, ::Method, ::Expr, ::Core.Compiler.OptimizationState, ::Bool, ::Nothing, ::Any) (0 children) ambiguous
                 3: signature Tuple{Type{Array{Any,1}},UndefInitializer,Any} triggered MethodInstance for type_lift_pass!(::Core.Compiler.IRCode) (1 children) ambiguous
   5 mt_cache

 inserting to_indices(A, I::Tuple{Vararg{Union{Integer, CartesianIndex},N} where N}) in Base at multidimensional.jl:705 invalidated:
   backedges: 1: superseding to_indices(A, I::Tuple{Any}) in Base at indices.jl:322 with MethodInstance for to_indices(::Array{Char,1}, ::Tuple{UInt64}) (1 children) ambiguous
   1 mt_cache

 inserting promote_rule(T::Type{Union{Missing, Nothing}}, S::Type) in Base at missing.jl:48 invalidated:
   backedges: 1: superseding promote_rule(T::Type{var"#s71"} where var"#s71">:Nothing, S::Type) in Base at some.jl:21 with MethodInstance for promote_rule(::Type{var"#s71"} where var"#s71">:Nothing, ::Type{Tuple{Tuple{Symbol},UnionAll,UnionAll}}) (1 children) more specific

 inserting <(::Missing, ::Any) in Base at missing.jl:84 invalidated:
   backedges: 1: superseding <(x, y) in Base at operators.jl:277 with MethodInstance for <(::Any, ::Char) (1 children) more specific
   3 mt_cache

 inserting <(::Any, ::Missing) in Base at missing.jl:85 invalidated:
   backedges: 1: superseding <(x, y) in Base at operators.jl:277 with MethodInstance for <(::Char, ::Any) (1 children) more specific

 inserting max(x::T, y::T) where T<:AbstractFloat in Base.Math at math.jl:711 invalidated:
   backedges: 1: superseding max(x::Real, y::Real) in Base at promotion.jl:358 with MethodInstance for max(::Real, ::Real) (1 children) more specific
   22 mt_cache

 inserting any(f::Function, a::AbstractArray; dims) in Base at reducedim.jl:729 invalidated:
   backedges: 1: superseding any(f, itr) in Base at reduce.jl:871 with MethodInstance for any(::Base.var"#390#392", ::Array{Any,1}) (1 children) more specific
   4 mt_cache

 inserting AbstractArray{T,N}(A::AbstractArray{S,N}) where {T, N, S} in Base at array.jl:565 invalidated:
   mt_backedges: 1: signature Tuple{Type{AbstractArray{_A,1}} where _A,Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}} triggered MethodInstance for convert(::Type{AbstractArray{T,1}}, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) where T (2 children) less specific

 inserting sizeof(s::AbstractString) in Base at strings/basic.jl:177 invalidated:
   backedges: 1: superseding sizeof(x) in Base at essentials.jl:449 with MethodInstance for sizeof(::String) (2 children) more specific
   40 mt_cache

 inserting lock(s::Base.LibuvStream) in Base at stream.jl:224 invalidated:
   backedges: 1: superseding lock(::IO) in Base at io.jl:26 with MethodInstance for lock(::IO) (2 children) more specific
   24 mt_cache

 inserting unlock(s::Base.LibuvStream) in Base at stream.jl:225 invalidated:
   backedges: 1: superseding unlock(::IO) in Base at io.jl:27 with MethodInstance for unlock(::IO) (2 children) more specific
   1 mt_cache

 
 inserting promote_rule(::Type{var"#s847"} where var"#s847"<:AbstractIrrational, ::Type{T}) where T<:Real in Base at irrationals.jl:42 invalidated:
   backedges: 1: superseding promote_rule(::Type{var"#s71"} where var"#s71", ::Type{var"#s70"} where var"#s70") in Base at promotion.jl:235 with MethodInstance for promote_rule(::Type{T} where T<:Unsigned, ::Type{UInt64}) (5 children) more specific
   1 mt_cache

 deleting include(mod::Module, path::String) in Base at Base.jl:262 invalidated:
   backedges: 1: superseding dummy() in SnoopCompileAnalysis at /home/tim/.julia/dev/SnoopCompile/SnoopCompileAnalysis/src/invalidations.jl:10 with MethodInstance for dummy() (5 children) ambiguous
   108 mt_cache

 inserting (::Type{T})(x::Tuple) where T<:Tuple in Base at tuple.jl:225 invalidated:
   mt_backedges: 1: signature Tuple{Type{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode}},Any} triggered MethodInstance for unsafe_getindex(::Core.Compiler.StepRangeLen{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},R,S} where S where R, ::Int64) (6 children) ambiguous

 inserting all(a::AbstractArray; dims) in Base at reducedim.jl:731 invalidated:
   backedges: 1: superseding all(itr) in Base at reduce.jl:836 with MethodInstance for all(::Array{Bool,1}) (7 children) more specific
   2 mt_cache

 deleting include(mod::Module, path::String) in Base at Base.jl:10 invalidated:
   backedges: 1: superseding dummy() in SnoopCompileAnalysis at /home/tim/.julia/dev/SnoopCompile/SnoopCompileAnalysis/src/invalidations.jl:10 with MethodInstance for dummy() (8 children) ambiguous
   4 mt_cache

 inserting convert(::Type{T}, s::T) where T<:AbstractString in Base at strings/basic.jl:229 invalidated:
   mt_backedges: 1: signature Tuple{typeof(convert),Type{AbstractString},Any} triggered MethodInstance for Base.SimdLoop.SimdError(::Any) (6 children) ambiguous
   backedges: 1: superseding convert(::Type{T}, x::T) where T in Base at essentials.jl:171 with MethodInstance for convert(::Type{AbstractString}, ::AbstractString) (1 children) more specific
              2: superseding convert(::Type{T}, x::T) where T in Base at essentials.jl:171 with MethodInstance for convert(::Type{String}, ::String) (2 children) more specific

 inserting all(f::Function, a::AbstractArray; dims) in Base at reducedim.jl:732 invalidated:
   backedges: 1: superseding all(f, itr) in Base at reduce.jl:918 with MethodInstance for all(::typeof(identity), ::Array{Bool,1}) (1 children) more specific
              2: superseding all(f, itr) in Base at reduce.jl:918 with MethodInstance for all(::Base.var"#384#385"{_A} where _A, ::Any) (3 children) more specific
              3: superseding all(f, itr) in Base at reduce.jl:918 with MethodInstance for all(::Base.var"#388#389", ::Array{Any,1}) (5 children) more specific
   5 mt_cache

 inserting hash(s::Union{SubString{String}, String}, h::UInt64) in Base at hashing2.jl:239 invalidated:
   backedges: 1: superseding hash(x, h::UInt64) in Base at hashing.jl:23 with MethodInstance for hash(::String, ::UInt64) (10 children) more specific
   93 mt_cache

 inserting codeunit(s::Test.GenericString) in Test at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1586 invalidated:
   mt_backedges: 1: signature Tuple{typeof(codeunit),AbstractString} triggered MethodInstance for codeunit(::SubstitutionString) (0 children) more specific
                 2: signature Tuple{typeof(codeunit),AbstractString} triggered MethodInstance for sizeof(::AbstractString) (0 children) more specific
                 3: signature Tuple{typeof(codeunit),AbstractString} triggered MethodInstance for map(::typeof(lowercase), ::AbstractString) (0 children) more specific
                 4: signature Tuple{typeof(codeunit),AbstractString} triggered MethodInstance for map(::typeof(uppercase), ::AbstractString) (0 children) more specific
                 5: signature Tuple{typeof(codeunit),AbstractString} triggered MethodInstance for codeunit(::SubString) (10 children) more specific

 inserting !(::Missing) in Base at missing.jl:100 invalidated:
   mt_backedges: 1: signature Tuple{typeof(!),Any} triggered MethodInstance for show_datatype(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type{var"#s429"} where var"#s429"<:Real) (0 children) more specific
                 2: signature Tuple{typeof(!),Any} triggered MethodInstance for show_call(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Symbol, ::Any, ::Any, ::Int64, ::Int64, ::Bool) (0 children) more specific
                 3: signature Tuple{typeof(!),Any} triggered MethodInstance for show_datatype(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type{var"#s429"} where var"#s429"<:Integer) (0 children) more specific
                 4: signature Tuple{typeof(!),Any} triggered MethodInstance for show_datatype(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Type{var"#s429"} where var"#s429"<:Unsigned) (0 children) more specific
                 5: signature Tuple{typeof(!),Any} triggered MethodInstance for mightalias(::Array{_A,1} where _A, ::Array{Any,1}) (2 children) more specific
                 6: signature Tuple{typeof(!),Any} triggered MethodInstance for !=(::Unsigned, ::Int64) (4 children) more specific
                 7: signature Tuple{typeof(!),Any} triggered MethodInstance for !=(::Any, ::Int64) (5 children) more specific

 inserting iterate(s::Test.GenericString) in Test at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1589 invalidated:
   mt_backedges: 1: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for print(::Base.GenericIOBuffer{Array{UInt8,1}}, ::AbstractString) (0 children) more specific
                 2: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for escape_raw_string(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::AbstractString) (0 children) more specific
                 3: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for Base.Iterators.Stateful(::AbstractString) (0 children) more specific
                 4: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for escape_raw_string(::Base.GenericIOBuffer{Array{UInt8,1}}, ::AbstractString) (0 children) more specific
                 5: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for map(::typeof(lowercase), ::AbstractString) (0 children) more specific
                 6: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for map(::typeof(uppercase), ::AbstractString) (0 children) more specific
                 7: signature Tuple{typeof(iterate),AbstractString} triggered MethodInstance for iterate(::SubstitutionString) (11 children) more specific
   1 mt_cache

 inserting promote_rule(T::Type{Missing}, S::Type) in Base at missing.jl:47 invalidated:
   backedges: 1: superseding promote_rule(::Type{var"#s71"} where var"#s71", ::Type{var"#s70"} where var"#s70") in Base at promotion.jl:235 with MethodInstance for promote_rule(::Type, ::Type{Any}) (3 children) more specific
              2: superseding promote_rule(::Type{var"#s71"} where var"#s71", ::Type{var"#s70"} where var"#s70") in Base at promotion.jl:235 with MethodInstance for promote_rule(::Type{S} where S, ::Type{Tuple{Tuple{Symbol},UnionAll,UnionAll}}) (3 children) more specific
              3: superseding promote_rule(::Type{var"#s71"} where var"#s71", ::Type{var"#s70"} where var"#s70") in Base at promotion.jl:235 with MethodInstance for promote_rule(::Type{T} where T, ::Type{Any}) (4 children) more specific
              4: superseding promote_rule(::Type{var"#s71"} where var"#s71", ::Type{var"#s70"} where var"#s70") in Base at promotion.jl:235 with MethodInstance for promote_rule(::DataType, ::Type{Any}) (5 children) more specific
   18 mt_cache

 inserting to_indices(A, inds, I::Tuple{CartesianIndices,Vararg{Any,N} where N}) in Base.IteratorsMD at multidimensional.jl:392 invalidated:
   mt_backedges: 1: signature Tuple{typeof(to_indices),Any,Any,Tuple} triggered MethodInstance for to_indices(::Any, ::Tuple) (0 children) more specific
                 2: signature Tuple{typeof(to_indices),Any,Tuple,Tuple} triggered MethodInstance for to_indices(::Any, ::Any, ::Tuple{Any,Vararg{Any,N} where N}) (16 children) ambiguous
   backedges: 1: superseding to_indices(A, inds, I::Tuple{Any,Vararg{Any,N} where N}) in Base at indices.jl:324 with MethodInstance for to_indices(::Any, ::Tuple{Any}, ::Tuple{Any}) (2 children) more specific
   66 mt_cache

 inserting (::Type{T})(x::BigInt) where T<:Union{UInt128, UInt16, UInt32, UInt64, UInt8} in Base.GMP at gmp.jl:347 invalidated:
   mt_backedges: 1: signature Tuple{Type{UInt64},Integer} triggered MethodInstance for convert(::Type{UInt64}, ::Integer) (3 children) ambiguous
                 2: signature Tuple{Type{UInt64},Integer} triggered MethodInstance for convert(::Type{UInt64}, ::Integer) (15 children) ambiguous
   41 mt_cache

 inserting (NamedTuple{names,T} where T<:Tuple)(nt::NamedTuple) where names in Base at namedtuple.jl:93 invalidated:
   mt_backedges: 1: signature Tuple{Type{NamedTuple{_A,T} where T<:Tuple} where _A,NamedTuple{names,T} where T<:Tuple where names} triggered MethodInstance for tail(::NamedTuple{names,T} where T<:Tuple) where names (29 children) equal specificity

 inserting (::Type{T})(x::BigInt) where T<:Union{Int128, Int16, Int32, Int64, Int8} in Base.GMP at gmp.jl:356 invalidated:
   mt_backedges: 1: signature Tuple{Type{Int64},Integer} triggered MethodInstance for _array_for(::Type{Any}, ::Any, ::Core.Compiler.HasLength) (0 children) ambiguous
                 2: signature Tuple{Type{Int64},Integer} triggered MethodInstance for _collect(::Type{Core.LineInfoNode}, ::Any, ::Core.Compiler.HasLength) (0 children) ambiguous
                 3: signature Tuple{Type{Int64},Integer} triggered MethodInstance for _array_for(::Type{Any}, ::Any, ::Base.HasLength) (0 children) ambiguous
                 4: signature Tuple{Type{Int64},Integer} triggered MethodInstance for _check_bitset_bounds(::Integer) (1 children) ambiguous
                 5: signature Tuple{Type{Int64},Integer} triggered MethodInstance for _collect(::Type{Method}, ::Core.Compiler.Generator{_A,Core.Compiler.var"#16#18"} where _A, ::Core.Compiler.HasLength) (2 children) ambiguous
                 6: signature Tuple{Type{Int64},Integer} triggered MethodInstance for SubString(::SubString, ::Int64, ::Integer) (2 children) ambiguous
                 7: signature Tuple{Type{Int64},Integer} triggered MethodInstance for SubString(::SubString, ::Integer, ::Integer) (2 children) ambiguous
                 8: signature Tuple{Type{Int64},Integer} triggered MethodInstance for SubString(::SubString, ::Integer, ::Int64) (7 children) ambiguous
                 9: signature Tuple{Type{Int64},Integer} triggered MethodInstance for convert(::Type{Int64}, ::Integer) (19 children) ambiguous

 inserting map!(f::Tf, C::SparseArrays.AbstractSparseMatrixCSC, A::SparseArrays.AbstractSparseMatrixCSC, Bs::Vararg{SparseArrays.SparseMatrixCSC,N}) where {Tf, N} in SparseArrays.HigherOrderFns at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.6/SparseArrays/src/higherorderfns.jl:148 invalidated:
   mt_backedges: 1: signature Tuple{typeof(map!),typeof(Base._views),Any,Any} triggered MethodInstance for mapany(::typeof(Base._views), ::Any) (8 children) ambiguous
                 2: signature Tuple{typeof(map!),typeof(Base.Docs.tvar),Any,Any} triggered MethodInstance for mapany(::typeof(Base.Docs.tvar), ::Any) (29 children) ambiguous
   backedges: 1: superseding map!(f::F, dest::AbstractArray, A::AbstractArray) where F in Base at abstractarray.jl:2147 with MethodInstance for map!(::typeof(Base.Docs.tvar), ::AbstractArray, ::AbstractArray) (1 children) ambiguous
   21 mt_cache

 inserting Array{T,1}(r::AbstractRange{T}) where T in Base at range.jl:995 invalidated:
   mt_backedges: 1: signature Tuple{Type{Array{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},1}},AbstractArray} triggered MethodInstance for convert(::Type{Array{Tuple{Core.SlotNumber,Core.Compiler.NewSSAValue,Core.PhiCNode},1}}, ::AbstractArray) (0 children) ambiguous
                 2: signature Tuple{Type{Array{Int32,1}},AbstractArray} triggered MethodInstance for convert(::Type{Array{Int32,1}}, ::AbstractArray) (4 children) ambiguous
                 3: signature Tuple{Type{Array{Int64,1}},AbstractArray} triggered MethodInstance for convert(::Type{Array{Int64,1}}, ::AbstractArray) (10 children) ambiguous
                 4: signature Tuple{Type{Array{Any,1}},AbstractArray} triggered MethodInstance for convert(::Type{Array{Any,1}}, ::AbstractArray) (15 children) ambiguous
                 5: signature Tuple{Type{Array{Method,1}},AbstractArray} triggered MethodInstance for convert(::Type{Array{Method,1}}, ::AbstractArray) (34 children) ambiguous
   3 mt_cache

 inserting with_output_color(f::Function, color::Union{Int64, Symbol}, io::IO, args...; bold) in Base at util.jl:69 invalidated:
   mt_backedges: 1: signature Tuple{typeof(Base.with_output_color),Base.var"#585#588"{String},Symbol,IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}} triggered MethodInstance for (::Base.var"#584#587"{String})(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}) (81 children) less specific
   36 mt_cache

 inserting (::Type{T})(x::Float16) where T<:Integer in Base at float.jl:71 invalidated:
   mt_backedges: 1: signature Tuple{Type{Bool},Number} triggered MethodInstance for convert(::Type{Bool}, ::Number) (1 children) ambiguous
                 2: signature Tuple{Type{Int64},Real} triggered MethodInstance for convert(::Type{Int64}, ::Real) (1 children) ambiguous
                 3: signature Tuple{Type{Int32},Any} triggered MethodInstance for unsafe_getindex(::Core.Compiler.StepRangeLen{Int32,R,S} where S where R, ::Int64) (3 children) ambiguous
                 4: signature Tuple{Type{Int32},Any} triggered MethodInstance for lerpi(::Int64, ::Int64, ::Int32, ::Int32) (6 children) ambiguous
                 5: signature Tuple{Type{Int32},Number} triggered MethodInstance for convert(::Type{Int32}, ::Number) (15 children) ambiguous
                 6: signature Tuple{Type{UInt64},Number} triggered MethodInstance for convert(::Type{UInt64}, ::Number) (29 children) ambiguous
                 7: signature Tuple{Type{Int64},Number} triggered MethodInstance for convert(::Type{Int64}, ::Number) (53 children) ambiguous

 inserting mapreduce(f, op, A::Union{Base.AbstractBroadcasted, AbstractArray}; dims, init) in Base at reducedim.jl:310 invalidated:
   backedges: 1: superseding mapreduce(f, op, itr; kw...) in Base at reduce.jl:287 with MethodInstance for mapreduce(::typeof(Base.operator_precedence), ::typeof(min), ::Array{Any,1}) (115 children) more specific

 inserting (::Type{T})(itr) where T<:Tuple in Base at tuple.jl:230 invalidated:
   mt_backedges: 1: signature Tuple{Type{V} where V<:Core.Compiler.BitArray{1},Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}} triggered MethodInstance for convert(::Type{V} where V<:Core.Compiler.BitArray{1}, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) (2 children) ambiguous
                 2: signature Tuple{Type{T} where T<:(Array{T,1} where T),Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}} triggered MethodInstance for convert(::Type{T}, ::Array{var"#s114",1} where var"#s114"<:Union{Float32, Float64}) where T<:(Array{T,1} where T) (129 children) ambiguous

 inserting ncodeunits(s::Test.GenericString) in Test at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1585 invalidated:
   mt_backedges:  1: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for thisind(::AbstractString, ::Int64) (0 children) more specific
                  2: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for lastindex(::AbstractString) (0 children) more specific
                  3: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for checkbounds(::Type{Bool}, ::AbstractString, ::UnitRange{Int64}) (0 children) more specific
                  4: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for nextind(::AbstractString, ::Int64, ::Int64) (0 children) more specific
                  5: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for isempty(::AbstractString) (0 children) more specific
                  6: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for checkbounds(::Type{Bool}, ::AbstractString, ::Int64) (0 children) more specific
                  7: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for findnext(::Base.Fix2{typeof(isequal),Char}, ::AbstractString, ::Int64) (0 children) more specific
                  8: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for length(::AbstractString, ::Int64, ::Int64) (0 children) more specific
                  9: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for sizeof(::AbstractString) (0 children) more specific
                 10: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for normalize_key(::AbstractString) (0 children) more specific
                 11: signature Tuple{typeof(ncodeunits),AbstractString} triggered MethodInstance for ncodeunits(::SubstitutionString) (134 children) more specific
   154 mt_cache

 inserting getindex(A::Array, i1::Union{Integer, CartesianIndex}, I::Union{Integer, CartesianIndex}...) in Base at multidimensional.jl:557 invalidated:
   backedges: 1: superseding getindex(A::AbstractArray, I...) in Base at abstractarray.jl:1050 with MethodInstance for getindex(::Array{Char,1}, ::UInt64) (218 children) more specific
   15 mt_cache

Fascinating. Altogether 761 unique non-mt_cache invalidations. BUT, I've checked 4-5 of the ones on your list and I'm not seeing them. So even though it's an intriguing finding, I'm a bit skeptical that invalidation explains why these methods are being (re)compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants