Potential performance regressions in Julia 1.8 for special un-precompiled type dispatches and how to fix them

Regarding the output format for the invalidations reports, we’ve incorporated a relatively generic way of creating tables (e.g., below) that are similar to the plots made (e.g. here) but with more information (file / line number / method names) in ReportMetrics.jl. The script looks like

using SnoopCompileCore
invalidations = @snoopr begin
    # load packages & do representative work
    nothing
end;
import ReportMetrics
ReportMetrics.report_invalidations(;
    job_name = "invalidations",
    invalidations,
    process_filename = x -> last(split(x, "packages/")),
)

And the output table looks like, for example:

┌─────────────────────────────────────────────────────┬───────────────────┬───────────────┬─────────────────┐
│ <file name>:<line number>                           │    Method Name    │ Invalidations │ Invalidations % │
│                                                     │                   │    Number     │     (xᵢ/∑x)     │
├─────────────────────────────────────────────────────┼───────────────────┼───────────────┼─────────────────┤
│ ChainRulesCore/oBjCg/src/tangent_types/thunks.jl:29 │ ChainRulesCore.== │      179      │       63        │
│ ChainRulesCore/oBjCg/src/tangent_types/thunks.jl:28 │ ChainRulesCore.== │      104      │       36        │
│ ChainRulesCore/oBjCg/src/tangent_arithmetic.jl:105  │ ChainRulesCore.*  │       2       │        1        │
└─────────────────────────────────────────────────────┴───────────────────┴───────────────┴─────────────────┘

Could this be somehow incorporated into the GitHub action for invalidations?

3 Likes