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

A lot of method invalidations coming from InlineStrings #22

Closed
baggepinnen opened this issue Jan 13, 2022 · 1 comment
Closed

A lot of method invalidations coming from InlineStrings #22

baggepinnen opened this issue Jan 13, 2022 · 1 comment

Comments

@baggepinnen
Copy link

I'm doing some work improving compile times for a number of packages and noticed that InlineStrings keep popping up as a large source of invalidations. I'm not sure how large of a problem this is in practice, but I figured I'll mention it in case you have an easy fix for it

julia> show(trees[end-1])
inserting String(x::T) where T<:InlineStrings.InlineString in InlineStrings at /home/fredrikb/.julia/packages/InlineStrings/aWvyB/src/InlineStrings.jl:114 invalidated:
   backedges: 1: superseding String(s::AbstractString) in Base at strings/string.jl:82 with MethodInstance for String(::AbstractString) (512 children)
   25 mt_cache
false



julia> show(trees[end-2])
inserting string(a::Union{Char, SubString{String}, String}, b::Union{Char, SubString{String}, String}, c::InlineStrings.InlineString) in InlineStrings at /home/fredrikb/.julia/packages/InlineStrings/aWvyB/src/InlineStrings.jl:400 invalidated:
   backedges: 1: superseding string(xs...) in Base at strings/io.jl:185 with MethodInstance for string(::Char, ::Vararg{Any}) (1 children)
              2: superseding string(xs...) in Base at strings/io.jl:185 with MethodInstance for string(::Any, ::Char, ::Any) (9 children)
              3: superseding string(xs...) in Base at strings/io.jl:185 with MethodInstance for string(::Any, ::String, ::Any) (12 children)
              4: superseding string(xs...) in Base at strings/io.jl:185 with MethodInstance for string(::String, ::String, ::Any) (50 children)
              5: superseding string(xs...) in Base at strings/io.jl:185 with MethodInstance for string(::String, ::Vararg{Any}) (360 children)
   3 mt_cache
false

The code I ran to get the data was

using SnoopCompile
invalidations = @snoopr begin
    using ControlSystems
end;

trees = SnoopCompile.invalidation_trees(invalidations);
@quinnj
Copy link
Member

quinnj commented Apr 19, 2022

Should be fixed by JuliaLang/julia#44500

@quinnj quinnj closed this as completed Apr 19, 2022
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

No branches or pull requests

2 participants