I have a 10GB Data.Vector.Unboxed vector that I want to efficiently save to disk. What's the best, most efficient way? I plan to read it from a memory-mapped file too.
I have seen this package this package but only works with Storable but I need to stay with unboxed.
I was thinking of converting to a list but I am assuming this is not very ideal.
You can convert between Vector types at the cost of an O(n)
traversal of the entire vector. The function you're looking for is convert
. As long as you're not planning to write this vector out to disk often, this cost should not be significant over all, and certainly faster than actually writing the vector out to disk. However, if you find yourself paying this cost often, you should probably rethink the algorithm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With