Random access on a huge file in haskell -
what best way read huge file (around 1 tb) in haskell. file contains matrix of integer data. , may need (efficiently ) calculate correlation between different rows or between columns.
i have used pytables thinking of trying same in haskell. know haskell has hdf5 bindings there other options not aware of ?
you give mmap try. example, can map whole file bytestring
:
import data.bytestring b import system.io.mmap main = bs <- mmapfilebytestring "mylargefile" nothing let l = b.length bs print l -- print last 1024 bytes: let bs2 = b.drop (l - 1024) bs print (b.unpack bs2)
cutting piece out of fast - no data copied. can use whatever tool parse bytestring
s.
Comments
Post a Comment