How are invalidated MethodInstances found, and how well does the process scale?

Benny
Mon, 20 Jun 2022 23:59:58 +0000
Internals & Design

From what I understand, compiled methods (for clarity I’ll call them MethodInstances) are invalidated when methods are defined, e.g. f(x) = 1; f(1); f(x::Real) = 2. I imagine the most wasteful algorithm would be to check every existing MethodInstance for a function to see if it would involve the newly defined method. What is the actual algorithm doing and how does it scale with number of MethodInstances for a function?

(For anyone who stumbles on this thread in the future, implementation details can change freely).

8 posts - 3 participants