TIFF: Bad performance on write in virtualized environment
|Reported by:||Even Rouault||Owned by:||Even Rouault|
TIFFAppendToStrip() calls TIFFSeekFile(tif, 0, SEEK_END) to figure out the start offset of the strip that is going to be written
_tiffSeekProc() then does a VSIFSeekL( fpL, 0, SEEK_END ) and VSIFTellL().
When tracing system calls, this causes fstat(), lseek() and read() to be called due to the way glibc buffers I/O. In some environnents (like Vagrant), this is really slow.
- once we are at the end of the file, it is possible to avoid the seek() in later attempts by having state variable. This can be done in the tifvsi layer (in case libtiff would be used in weird contexts with multiple updating processes/threads...)
- and we can also buffer a bit data to be written to reduce the number of write()