AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2017.11.20 17:04 "[Tiff] TIFF tag and compression registration", by Kemp Watson
2017.11.20 17:34 "Re: [Tiff] TIFF tag and compression registration", by Bob Friesenhahn
2017.11.20 21:01 "Re: [Tiff] TIFF tag and compression registration", by Kemp Watson
2018.01.16 20:08 "Re: [Tiff] Strategies for multi-core speedups", by
2018.01.16 00:15 "Re: [Tiff] Strategies for multi-core speedups", by Bob Friesenhahn
2018.01.15 21:41 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.15 19:17 "[Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.15 20:23 "Re: [Tiff] Strategies for multi-core speedups", by Bob Friesenhahn
2018.01.15 22:02 "Re: [Tiff] Strategies for multi-core speedups", by Olivier Paquet
2018.01.15 22:47 "Re: [Tiff] Strategies for multi-core speedups", by Craig Bruce
2018.01.15 22:38 "Re: [Tiff] Strategies for multi-core speedups", by Craig Bruce
2018.01.15 22:43 "Re: [Tiff] Strategies for multi-core speedups", by scott ribe
2018.01.15 21:46 "Re: [Tiff] Strategies for multi-core speedups", by scott ribe
2018.01.15 21:51 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.16 01:09 "Re: [Tiff] Strategies for multi-core speedups", by Craig Bruce
2018.01.16 18:36 "Re: [Tiff] Strategies for multi-core speedups", by
2018.01.15 23:29 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.16 00:24 "Re: [Tiff] Strategies for multi-core speedups", by Bob Friesenhahn
2018.01.16 00:43 "Re: [Tiff] Strategies for multi-core speedups", by Paul Hemmer
2018.01.16 00:58 "Re: [Tiff] Strategies for multi-core speedups", by scott ribe
2018.01.16 07:31 "Re: [Tiff] Strategies for multi-core speedups", by Paavo Helde
2018.01.17 02:00 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.24 00:33 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz
2018.01.16 18:48 "Re: [Tiff] Strategies for multi-core speedups", by scott ribe
2018.01.16 19:01 "Re: [Tiff] Strategies for multi-core speedups", by Kemp Watson
2018.01.16 19:17 "Re: [Tiff] Strategies for multi-core speedups", by
2018.01.16 19:34 "Re: [Tiff] Strategies for multi-core speedups", by Paavo Helde
2018.01.16 19:52 "Re: [Tiff] Strategies for multi-core speedups", by Kemp Watson
2018.01.16 19:57 "Re: [Tiff] Strategies for multi-core speedups", by
2018.01.16 20:18 "Re: [Tiff] Strategies for multi-core speedups", by Kemp Watson
2018.01.16 20:20 "Re: [Tiff] Strategies for multi-core speedups", by Kemp Watson
2018.01.16 20:23 "Re: [Tiff] Strategies for multi-core speedups", by

2018.01.24 00:33 "Re: [Tiff] Strategies for multi-core speedups", by Larry Gritz

Update: I have more or less final results, having implemented my scheme for both reading and writing, both scanline and tiled images. And also refined the output technique it a bit more since my preliminary report.

As an example of the performance gain, one use case I come across frequently is in our "texture creation", wherein we take a source scanline TIFF file, read it, compute a bunch of image statistics on the pixels, then output it tiled and multi-resolution (successively halving the resolution and appending it to make a multi-subimage file). The filtered resize that generates the successive lower-res images was already parallelized in my implementation, so by far the biggest portion of runtime was writing the output, and my intuition was that the majority of that was the deflate compression, which has no good reason to be serialized.

Previously, doing this on a TIFF file of 8192 x 8192 x 4 channel x 16 bit unsigned integer values took 28.2s total, of which 1.13s was reading the source image, and 23.3s writing all the subimages of the result.

With my changes, on my 16 core workstation (32 hyperthreads), the same operation takes 1.6s total (0.13s read, 1.0s write).

(Those times also incorporate the fact that I found another item on my side of the code, accounting for ~3 seconds of the original total, that I'd failed to parallelize, so I did that, too.)

That's a particularly good case. For some other use cases (different operations, similar amount of I/O), I'm only getting 6-10x improvement.

> On Jan 16, 2018, at 6:00 PM, Larry Gritz <lg@larrygritz.com <mailto:lg@larrygritz.com>> wrote:

Status report: I've implemented this, thanks to Scott Ribe's suggestion of not trying to struggle with libtiff's codec internals, but just calling zlib directly, then TIFFWriteRawStrip (this strategy only works for deflate compression, but that's my common case anyway). The strips' data are compressed in parallel.

I'm getting a 6x improvement in total time for writing large TIFF files.

--
Larry Gritz

lg@larrygritz.com <mailto:lg@larrygritz.com>