January 2020
Intermediate to advanced
532 pages
13h 31m
English
The StructArrays.jl package provides a convenient mechanism to quickly turn an array of structs into a struct of arrays. We must recognize that the price we are paying is an additional copy of the data in memory. Hence, we are once again getting into the classic space versus time trade-off in computing.
Let's quickly look into our use case again. We can use the Base.summarysize function in the Julia REPL to see the memory footprint:

The Base.summarysize function returns the size of the object in bytes. We divided the number 1024 twice to arrive at the mega-byte unit. It is interesting to see that ...
Read now
Unlock full access