2010.05.10 09:35 "[Tiff] Increasing the number of files loadable through libtiff", by Simon R. Proud

2010.05.10 16:17 "Re: [Tiff] Increasing the number of files loadable through libtiff", by Olivier Paquet

On Mon, May 10, 2010 at 11:51 AM, Bob Friesenhahn <bfriesen@simple.dallas.tx.us> wrote:

Out of interest: Is there any reason why memory mapping is enabled by default? Enabling it causes problems like the ones I have been having and, at least in my case, offers no speed advantage.

Libtiff seems to do a lot of file seeking and small reads because of

> the TIFF directory structures and organization.  The memory mapping

From a quick glance at the code, reading a directory looks like a single seek and 3 reads. Reading a tile/strip looks like one seek and one read. It shouldn't be too bad for most files.

> tends to help hide this because it provides a caching effect.  It also

helps quite a lot if the input file is opened and read several times without any other intermediate memory-hogging process which might lose the already cached data.

You should get the same caching benefit with ordinary reads on most operating systems.

Regardless, my own application defaults to not using memory mapping for input files.

Same for ours. It might be that there's a problem with the default value ;-) On the other hand, one could argue that people will never enable a feature they don't know about but will do what is needed to disable one which breaks their application. So leaving it on is best for everyone but the developers. At least running out of address space should no longer be an issue on 64-bit systems.

Olivier