Closed ianfiske closed 5 years ago
It may be due to the fact this is in global space. For instance simply calling @time
in global space gives 160 bytes of allocation
julia> function f() end
f (generic function with 1 method)
julia> @time f()
0.000192 seconds (378 allocations: 25.578 KiB)
julia> @time f()
0.000003 seconds (4 allocations: 160 bytes)
Thanks for that pointer @blegat . I tried moving the code into a module and my allocations actually went up! (https://gist.github.com/ianfiske/acbc4f39216b753bfea01f7b66a95f64)
However, I tried running the code in a terminal REPL instead of from Juno and that did the trick. The same code as the gist above, gives
@btime Parametron.solve!(model)
82.354 μs (0 allocations: 0 bytes)
Thanks, @blegat!
Hi, I am trying out Parametron v0.9.0 on Julia 1.1. Just running through the examples in the README.md and in the docs, and I can't seem to get the zero-allocations shown in any of the examples:
gives
Is there some change needed to reproduce the zero allocations?