2006.02.02 15:00 "Re: [Tiff] Fastest method to load tiff files?", by
The answer depends a little on what kind of TIFFs you'll be reading. If black and white, you'll find a nice example here:
- write several versions of your routines, using different strategies/ideas
- profile your code, and see where your bottlenecks are; if your code is slow, you can improve it -- if they are in libtiff itself, you're done
- always try to pre-compute the final memory requirements so you can allocate all at once (superfluous memory management can waste time)
- if you know certain things about types of images, and those types of images will always be used, you can optimize for them, although that would generally require tuning of the actual library, not the code that uses it (for instance, if it's a given that the images are always equal to or small than a certain size, you can allocate one buffer for that (maximum) size, and keep re-using that buffer, instead of allocating and de-allocating for each image in a batch -- realize, though, that the gains are likely to be marginal)
- if you really need that extra little bit of speed, you might be able to recompile libtiff with tweaked build settings for your target platform (consider things like byte-alignment, etc)
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com]On Behalf Of Edward Lam
> Sent: Thursday, February 2, 2006 9:34 AM
> To: firstname.lastname@example.org
> Subject: [Tiff] Fastest method to load tiff files?
Editor's note: This mail was not originally archived, and has been reconstructed from quotes.