Skip to content

Commit 8f73856

Browse files
authored
Add warning about blaming the victim (#34)
1 parent 8fc25a5 commit 8f73856

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Uses [`SnoopCompile.@snoop_invalidations`](https://timholy.github.io/SnoopCompile.jl/dev/tutorials/invalidations/)
33
to evaluate number of invalidations caused by `using Package` or a provided script.
44

5+
**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.
6+
7+
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).
8+
59
## Usage
610

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

0 commit comments

Comments
 (0)