Closed nsajko closed 7 months ago
It seems the issue is that get1
does not infer correctly ? Maybe fixing this underlying issue will save even more. What about annotating it with _NoVarTerm
?
Not sure why you think that? Have you checked with Cthulhu or something? The issue that I fixed in this PR is a standard performance of captured variables issue, where the closure is itself the captured variable, so making it nonrecursive prevents boxing, as far as I understand.
The local function was spuriously recursive, making it not recursive fixes the performance problem. That is, this removes some run time dispatch and decreases the amount of allocation, but there's still some run time dispatch left in other places, according to JET.jl.
Before:
After:
Both REPL runs was with nightly Julia v1.11.