Draft: Issue #9135 saving of xcf to network drive is slow
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:
- Unbuffered to hd, new name: takes between 0.14 and 0.16 secs.
- Unbuffered to hd, replacing the current file: between 2.8 and 3.0 secs.
- Buffered stream, new name: between 0.26 and 0.36 secs.
- Buffered, replace: between 4.3 and 4.9 secs.
Using zip compression:
- Unbuffered, new name: 0.31-0.33
- Unbuffered, replace: 1.8-2.1
- Buffered, new name: 0.33-0.37
- 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