Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5914 closed enhancement (fixed)

TIFF: Bad performance on write in virtualized environment

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 2.0.0
Component: default Version: unspecified
Severity: normal Keywords: tiff


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.

Optimizations :

  • 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()

Change History (3)

comment:1 Changed 7 years ago by Even Rouault

trunk r28872 "GTiff: speed optimization on write (at least in Vagrant) (#5914)"

trunk r28873 "GTiff: amendment to previous commit: no need to buffer on write on /vsimem/ (#5914)"

comment:2 Changed 7 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed
Type: defectenhancement

comment:3 Changed 6 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.