-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Labels
Description
It's a bit annoying when you have to use this convoluted Ref
trick to prevent the compiler from constant-folding the whole calculation (ala #130):
julia> @btime exp(1);
0.052 ns (0 allocations: 0 bytes)
julia> @btime exp($(Ref(1))[]);
13.785 ns (0 allocations: 0 bytes)
It would be nicer if we could just use @btime exp($1)
and the $
did the trick automatically.
(Another case just came up on discourse. cc @stillyslalom)
ettersi, stillyslalom, oscardssmith and gdalle