|TIFF and LibTiff Mail List Archive|
LibTiff Mailing List
2016.01.26 20:36 "Re: [Tiff] OpenMP enabled libtiff", by Bob Friesenhahn
On Tue, 26 Jan 2016, Aaron Boxer wrote:
Memory mapping is great if you plan to read the file more than once but if you plan to read the file just once, then it may impose a significant penalty. This is particularly true of the file is accessed over a network file system.
Often, there is no need to read the data more than once so using memory mapping wastes memory and may break the operating system's sequential access / read-ahead detection. It is likely that the (smart) operating system knows about file handles and tries to deduce the current behavior (e.g. sequential vs random access) of each file handle so as to know if or how much read-ahead should be done. TIFF is a strange format since it requires both sequential and random access behavior, unless one uses multiple file descriptors and the data is nicely ordered. Using multiple file descriptors (one to access IFDs and the other to read strip/tile data) may offer significant performance benefits.