julia
9417366e - subtype: Add a wrapper fast path to `jl_isa` (#64416)

Commit
8 days ago
subtype: Add a wrapper fast path to `jl_isa` (#64416) Since #59221 a task can carry an inferred `CodeInstance`, and `start_task` then goes through `jl_f_invoke`, which checks the closure argument against the method signature. For a closure with type parameters that signature element is the closure type's `name->wrapper`, which `jl_isa` could only answer through full subtyping. This made single-threaded `fetch(Threads.@spawn i)` roughly 30% slower than on 1.13. Every instance of a datatype is an instance of its `name->wrapper`, so `jl_isa` now returns true for that case directly. The check is positive only; everything else falls through to the existing code. The same path also speeds up other runtime `isa` checks against wrapper types such as `x isa Array` or `x isa Base.RefValue`. Assisted-by: Claude Code (Opus 5.5)
Author
Parents
Loading