alugowski / fast_matrix_market

Fast and full-featured Matrix Market I/O library for C++, Python, and R
BSD 2-Clause "Simplified" License
71 stars 7 forks source link

Evaluate mmap #33

Open alugowski opened 1 year ago

alugowski commented 1 year ago

FMM currently employs a single-pass method that effectively only uses fread(). This is fast, very flexible for integration, and has a fixed memory overhead for the loader itself. However it may leave some performance on the table on systems capable of parallel IO.

See PIGO which mmap()s the input file, scans it fully once to find line counts, then reads it.

mmap() does not apply to many situations that FMM currently handles, but may be useful as an option for cases where it does.

alugowski commented 1 year ago

See https://github.com/alugowski/sparse-matrix-io-comparison

alugowski commented 7 months ago

Get fileno from ifstream (gcc only): https://www.ginac.de/~kreckel/fileno/