mmap() vs. reading blocks

I’m working on a program that will be processing files that could potentially be 100GB or more in size. The files contain sets of variable length records. I’ve got a first implementation up and running and am now looking towards improving performance, particularly at doing I/O more efficiently since the input file gets scanned many … Read more

When should I use mmap for file access?

POSIX environments provide at least two ways of accessing files. There’s the standard system calls open(), read(), write(), and friends, but there’s also the option of using mmap() to map the file into virtual memory. When is it preferable to use one over the other? What’re their individual advantages that merit including two interfaces? 6 … Read more