2008.07.03 12:58 "Re[Tiff] ading / Writing in chunks", by Lev_B

2008.07.03 15:14 "Re: Re[Tiff] ading / Writing in chunks", by Bob Friesenhahn

Is there any way I can make LibTiff read and write in chunks of at least a given size?

I use memory mapping for reading. Tiffs are stripped.

This should be primarily a function of strip size, for which libtiff provides several explicit APIs. However, it is important to recognize that memory mapped I/O is different than programmed I/O. With memory-mapped I/O the I/O happens when the CPU accesses an address which corresponds to a new memory page (page could be 4K, 8k, 16k in size depending on system architecture), or the OS decides to flush a dirty (updated) page. The number of pages transferred to/from memory at once is up to the OS/MMU and not libtiff.

Libtiff is not particularly sophisticated with its memory mapping. It maps the whole file at once and does not use any APIs to suggest that the OS should pre-read certain pages or expire certain pages.

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