The current strategy is to preallocate a large array based on nout, which often leads to a waste of memory when tracing is terminated early. I remember Chris had a tutorial demonstrating that pushing to arrays has the same performance as preallocation in this case. Check it out.
https://github.com/henry2004y/TestParticle.jl/blob/e24fbe0abc2c5e2449717250b3ef433581d61834/src/pusher.jl#L165
The current strategy is to preallocate a large array based on
nout
, which often leads to a waste of memory when tracing is terminated early. I remember Chris had a tutorial demonstrating that pushing to arrays has the same performance as preallocation in this case. Check it out.