Skip to content

Conversation

@ranocha
Copy link
Member

@ranocha ranocha commented Aug 26, 2022

This required a bit of hunting an I'm not completely sure whether it fixes the problem, so please help me understand this better.

I ran SnoopCompile and found

inserting extrema(f::AbstractFFTs.Frequencies) in AbstractFFTs at ~/.julia/packages/AbstractFFTs/Wg2Yf/src/definitions.jl:456 invalidated:
   backedges: 1: superseding extrema(a::AbstractArray; dims, kw...) in Base at reducedim.jl:994 with MethodInstance for extrema(::AbstractVector) (30 children)
   9 mt_cache

Running

...
Choose a call for analysis (q to quit):
     extrema(::AbstractVector)
       #sort!#8(::Base.Sort.Algorithm, ::typeof(isless), ::typeof(identity), ::Nothing, ::Base.Order.ForwardOrder
         (::Base.var"#sort!##kw")(::NamedTuple{(:by,), Tuple{typeof(identity)}}, ::typeof(sort!), ::AbstractVecto
           #_print#10(::Int64, ::Bool, ::Bool, ::typeof(identity), ::typeof(TOML.Internals.Printer._print), ::Not
             (::TOML.Internals.Printer.var"#_print##kw")(::NamedTuple{(:sorted, :by), Tuple{Bool, typeof(identity
               (::TOML.Internals.Printer.var"#_print##kw")(::NamedTuple{(:sorted, :by), Tuple{Bool, typeof(identi
                 #print#15(::Bool, ::typeof(identity), ::typeof(TOML.Internals.Printer.print), ::IOStream, ::Abst
                   (::TOML.Internals.Printer.var"#print##kw")(::NamedTuple{(:sorted,), Tuple{Bool}}, ::typeof(TOM
 >                   (::Pkg.API.var"#152#183")(::IOStream)
...
Body::Core.Const(nothing)
    @ /cache/build/default-amdci4-3/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/API.jl:569 within `#152`
1%1  = (:sorted,)::Core.Const((:sorted,))
│   %2  = Core.apply_type(Core.NamedTuple, %1)::Core.Const(NamedTuple{(:sorted,)})
│   %3  = Core.tuple(true)::Core.Const((true,))
│   %4  = (%2)(%3)::Core.Const((sorted = true,))
│   %5  = Base.getproperty(Pkg.API.TOML, :print)::Core.Const(TOML.Internals.Printer.print)
│   %6  = Core.kwfunc(%5)::Core.Const(TOML.Internals.Printer.var"#print##kw"())
│   %7  = Base.getproperty(Pkg.API.TOML, :print)::Core.Const(TOML.Internals.Printer.print)
│   %8  = Core.getfield(#self#, :usage)::Core.Box

The Core.Box suggests the common problem with closures, so I added a let block. Is this okay?

@ranocha
Copy link
Member Author

ranocha commented Aug 30, 2022

I suggest the labels latency and backport-1.8 for this PR.

@KristofferC KristofferC merged commit 8a8c39c into JuliaLang:master Aug 30, 2022
@ranocha ranocha deleted the patch-3 branch August 30, 2022 09:56
@ranocha
Copy link
Member Author

ranocha commented Sep 1, 2022

@KristofferC It looks like this was not backported to release-1.8. Would you mind doing so - or should I create a PR? I would really like to get this into Julia v1.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants