knip icon indicating copy to clipboard operation
knip copied to clipboard

Img Writer: Writing Tiffs is _very_ slow

Open dietzc opened this issue 10 years ago • 12 comments

Writing a tiff with e.g. 1024,1024 and Z=51, Channel = 3 in this dimension order is super slow. One reason might be, that it seems that nearly every pixel write action is logged somewhere. @gab1one please reproduce and double check!

dietzc avatar May 22 '15 07:05 dietzc

Yes, the tiff writers (tiff and ome.tiff) are about 6.000% slower than eq. formats like ics. Even with small images. One example:

  • SCIFIO can write the same image (128,128, C=1 Z=1, T=50, ) 137.165 ± 2.115 times a second as ICS file but only about 2.093 ± 0.063 a second as (ome.)tiff file.
    take a look at the benchmark results

I removed logging from the TIFF format to check your hypothesis but it did not produce any meaningful performance improvement (up to 0.4 more operations more per second!). without logging

Larger files take much longer to write but show the same effect.

gab1one avatar May 22 '15 14:05 gab1one

see https://github.com/knime-ip/knip/commit/46b6799b83512270b9752ec555cef5cbdf95528b for the first big improvement. Writing the 160mb file sequentially now takes about 10 seconds instead of the 44 it took before

gab1one avatar May 23 '15 16:05 gab1one

great work @gab1one. Reading & Writing Tiffs (and also other formats) is very often used by the users and therefore performance is crucial.

dietzc avatar May 25 '15 09:05 dietzc

Further improvements depend on changes in SCIFIO, I will talk with Mark about that.

gab1one avatar Sep 18 '15 07:09 gab1one

Any news on this? I'm still suffering severe performance issues with the Image Writer.

Here's an example benchmark workflow: Image Writer Performance.zip

I get the following writing times for the different file formats:

Node 2    tif       254156 

Node 3    ome.tif   191286 

Node 4    ics       549 

imagejan avatar Jul 21 '16 08:07 imagejan

I think this is still a SCIFIO Problem. At the moment I can only recommend to use ics in favour of tiff. @ctrueden what do you think?

dietzc avatar Jul 21 '16 08:07 dietzc

I am aware of a SCIFIO issue for improving the performance of TIFF reading: scifio/scifio#7.

But is there an issue for improving the behavior of TIFF writing? I couldn't find it.

Has anyone profiled why TIFF writing is slow? I can't imagine it would be that hard to fix. #famouslastwords

ctrueden avatar Jul 22 '16 19:07 ctrueden

@gab1one can you reproduce the problem and open an issue in scifio?

dietzc avatar Jul 24 '16 16:07 dietzc

The slowness issue is reproducible in ImageJ, the relevant SCIFIO issue is https://github.com/scifio/scifio/issues/310.

imagejan avatar Apr 19 '17 15:04 imagejan

see also: https://tech.knime.org/forum/knime-image-processing/image-writer-cannot-write-to-network-drives#comment-48710

dietzc avatar Apr 21 '17 18:04 dietzc

Any news regarding tif writing speed? I am currently using the image writer to move my data to the python-nodes and it takes a very long time.

tibuch avatar May 17 '18 16:05 tibuch

@tibuch Sorry for the long delay in reply. Unfortunately, no one is working on TIFF performance. I am very sorry this has sat for so long, but the fact is that we still do not have a dedicated SCIFIO developer who has time to prioritize this issue... yet.

ctrueden avatar Aug 24 '18 19:08 ctrueden