While report_package is available, it can be imprecise due to generic type signatures. For more precise analysis, create a representative workload function (e.g., in src/workload.jl) that uses concrete types by exercising your package's functionality.
Workflow
- Define a function
exercise_mypkg() that calls your package functions with concrete data. - Run
@report_call exercise_mypkg() to get precise type-stability and error reports.
Analyzing existing PrecompileTools workloads
If you already have a precompilation workload, you can inspect the compiled methodinstances directly:
using MyPkg, JET, MethodAnalysis
# Get all compiled methodinstances for the package
mis = methodinstances(MyPkg)
# Filter for instances that produce JET reports (errors/instabilities)
badmis = filter(mis) do mi
!isempty(JET.get_reports(report_call(mi)))
end
# Inspect problematic instances
for mi in badmis
report_call(mi)
end
Caveats:
methodinstances(MyPkg) only covers functions owned by MyPkg. Extension methods (e.g., OtherPkg.f(...)) will be listed under OtherPkg.- Ensure precompilation is enabled; disabling it will result in a list of methodinstances that does not reflect real-world usage.
using MyPkg, JET, MethodAnalysis
# Get all compiled methodinstances for the package
mis = methodinstances(MyPkg)
# Filter for instances that produce JET reports
badmis = filter(mis) do mi
!isempty(JET.get_reports(report_call(mi)))
end