Skip to content

Draft: Issue #9135 saving of xcf to network drive is slow

Jacob Boerema requested to merge wip/wormnest/buffered-xcf-save into master

This tries to fix issue #9135 by using a buffered output stream as suggested by @lb90

Timing code is included at the moment to be able see if saving makes any difference. Currently I can only test on a regular (non-network, non-ssd) harddrive and for that it reduces the speed.

A 67MB xcf (34 MB with better compression selected) saves:

  1. Unbuffered to hd, new name: takes between 0.14 and 0.16 secs.
  2. Unbuffered to hd, replacing the current file: between 2.8 and 3.0 secs.
  3. Buffered stream, new name: between 0.26 and 0.36 secs.
  4. Buffered, replace: between 4.3 and 4.9 secs.

Using zip compression:

  1. Unbuffered, new name: 0.31-0.33
  2. Unbuffered, replace: 1.8-2.1
  3. Buffered, new name: 0.33-0.37
  4. Buffered, replace: 2.4-2.5

As said, these were not tested on a network drive, where the main problem seems to be, but we wouldn't want to slow or normal saving down and this seems to do that in all cases.

I am inviting others to test this on network drives to see how the performance differs. To test unbuffered comment out the line: buffered = g_buffered_output_stream_new (output);.

Edited by Jacob Boerema

Merge request reports

Loading