timholy / SnoopCompile.jl

Provide insights about latency (TTFX) for Julia packages
https://timholy.github.io/SnoopCompile.jl/dev/
Other
309 stars 48 forks source link

Require method ownership #154

Closed timholy closed 3 years ago

timholy commented 3 years ago

Based on poking around Julia's src/dump.c, it's my understanding that a disconnected (backedge-free) MethodInstance needs to be cached in the module owning the Method. The implication is that Base methods that get called on package-defined objects cannot be cached on their own merits, so we should exclude such MethodInstances.

The way to fix this is to make such calls inferrable, in which case they will be cached in the package module thanks to their backedges.