You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel like I've seen this issue reported before (functions hidden behind let declarations have a performance penalty), but I can't find it now. And I'm not sure that it was reduced to a minimal example.
It seems like we're missing a relatively simple optimization here — is Julia simply forgetting that x is const in this case? Or is this more complicated than I'm making it out to be?
Use-case: over in Benchmarks.jl, we'd like to support running @benchmark macro within a for loop. This involves defining a local benchmarking function(s). In order to prevent benchmarking dynamic dispatch, we assign any non-constant bindings in the expression to temporary constant bindings. For the most part, this works very well. But we'd prefer to avoid strange performance effects like these.
The text was updated successfully, but these errors were encountered:
I feel like I've seen this issue reported before (functions hidden behind
let
declarations have a performance penalty), but I can't find it now. And I'm not sure that it was reduced to a minimal example.It seems like we're missing a relatively simple optimization here — is Julia simply forgetting that
x
isconst
in this case? Or is this more complicated than I'm making it out to be?Use-case: over in Benchmarks.jl, we'd like to support running
@benchmark
macro within afor
loop. This involves defining a local benchmarking function(s). In order to prevent benchmarking dynamic dispatch, we assign any non-constant bindings in the expression to temporary constant bindings. For the most part, this works very well. But we'd prefer to avoid strange performance effects like these.The text was updated successfully, but these errors were encountered: