Closed tlienart closed 3 years ago
Good point. There's a section right ~below~above that, https://timholy.github.io/SnoopCompile.jl/stable/snoopr/#mt_backedges-invalidations, that covers the other type of backedge, the mt_backedges
. Would it help to insert a note pointing ~forward~back to that section?
And, while I'm at it, if I see something like:
julia> method_invalidations
inserting joinpath(uri::URIs.URI, parts::String...) in URIs at /Users/tlienart/.julia/packages/URIs/1jrj1/src/URIs.jl:466 invalidated:
mt_backedges: 1: signature Tuple{typeof(joinpath), Any, String} triggered MethodInstance for Artifacts.jointail(::Any, ::String) (0 children)
julia> sig, root = method_invalidations.mt_backedges[end]
Pair{Any, SnoopCompile.InstanceNode}(Tuple{typeof(joinpath), Any, String}, MethodInstance for Artifacts.jointail(::Any, ::String) at depth 0 with 0 children)
julia> root
MethodInstance for Artifacts.jointail(::Any, ::String) at depth 0 with 0 children
what should I do to fix it? (sorry, I feel like I'm re-learning Julia with SnoopCompile... 🙈 )
Generally ascend(root)
. Cthulhu is complicated but really amazing. Did you see the link to the video? https://www.youtube.com/watch?v=7VbXbI6OmYo
I feel like I'm re-learning Julia with SnoopCompile
I hear you. It definitely takes you into territory you've probably never explored before. Hopefully you emerge feeling like you've learned a few arts that are actually useful...but if not, I'd like to hear about it.
I'll read the docs and watch the videos, thanks Tim!
Oh, by the way: "0 children" roots are probably not worth your time. Focus on ones with bigger impact. Just loading Franklin, I get 323 invalidations, all from HTTP.jl. Unfortunately those look hard to solve, so my recommendation is to ignore them. (They only affect REPL and not your code.)
In your case, you are getting more invalidations when you run the test suite, and those do invalidate Franklin methods. I'd consider starting with that DataStructures one I noted elsewhere.
In playing with
@snoopr
, I gotfollowing the docs I tried:
this failed with
so maybe the doc should just clarify why there may not be such a backedge?