Closed visr closed 2 months ago
Does this allocation get elided?
Running this on the example from #669 I don't see any allocations, nor do I see it in a profile.
@btime SciMLBase.check_error!($integrator);
9.510 ns (0 allocations: 0 bytes)
I decided to give AllocCheck a try. It just triggered this which looks unrelated:
using AllocCheck
@check_allocs g(i, code) = SciMLBase.solution_new_retcode(i.sol, code)
g(integrator, ReturnCode.Default)
ERROR: @check_allocs function encountered 1 errors (1 allocations / 0 dynamic dispatches).
Allocating runtime call to "jl_get_pgcstack" in unknown location
Running AllocCheck on check_error!
does give some allocations from postamble!
calling resize!(integrator.sol.t, integrator.saveiter)
.
I mean in the context of a normal solve. Elision should happen in isolation but I want to make sure the compiler doesn't hit some limit say on Lorenz.
I saw allocations coming from postamble!
. Since that isn't what I'm interested in, I put that back in the if block.
Now the number of allocations for Lorentz is all from setup, just like in this example:
Sorry for the delayed review, but add an allocs test and this is good.
That should be sufficient.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 31.74%. Comparing base (
d947bed
) to head (14f6bce
). Report is 25 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Fixes #669.
I'm not sure why this check was there. Was it just to save work? Why should the postamble not run if it is successful?