henry2004y / Vlasiator.jl

Data processor for Vlasiator
https://henry2004y.github.io/Vlasiator.jl/stable/
MIT License
6 stars 4 forks source link

Subarrays or arrays? #131

Open henry2004y opened 1 year ago

henry2004y commented 1 year ago

In readvariable, https://github.com/henry2004y/Vlasiator.jl/blob/e44af63de66306b68cf660d28a6199c5d4a0f736/src/vlsv/vlsvreader.jl#L508

making it a view would save about half the memory usage and result in 2~7 times faster in reading EGI outputs. The downside, however, is that the new return arrays are now subarrays instead of regular arrays. Is it worth it?

The speedup is not obvious for thousand of cells, e.g., in bulk.2d.vlsv.