2016.01.25 18:25 "[Tiff] OpenMP enabled libtiff", by Aaron Boxer

2016.01.26 20:36 "Re: [Tiff] OpenMP enabled libtiff", by Bob Friesenhahn

On Tue, 26 Jan 2016, Aaron Boxer wrote:

>
> By the way, since libtiff uses memory mapped files as default, 

using multiple handles isn't that bad, because the handles will all access the same memory mapping, at least on unices.

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.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/