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

Add warning about blaming the victim #34

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Uses [`SnoopCompile.@snoop_invalidations`](https://timholy.github.io/SnoopCompile.jl/dev/tutorials/invalidations/)
to evaluate number of invalidations caused by `using Package` or a provided script.

**WARNING**: *this action may place blame in the wrong place*. In most cases invalidation is the "fault" of the *victim* of invalidation, not the *perpetrator*: adding a new method to an external function only triggers invalidation if the code being invalidated is not inferrable. Concretely, suppose PkgA depends just on Julia itself, and PkgB depends on PkgA. PkgA has some precompiled code that is not inferrable, and PkgB adds a new method to a function defined in Base that invalidates this precompiled code. If PkgB is using `julia-invalidations`, it "takes the heat" for lack of inferrability in PkgA's code. But most often, the fix is in PkgA.

To check whether your package's code is *resistant* to invalidation, you can test for inferability with [JET](https://aviatesk.github.io/JET.jl/dev/optanalysis/#optanalysis-test-integration).

## Usage

This is a composite github action, that can be inserted into a github action on the target repo to evaluate number of invalidations
Expand Down
Loading