gio: Bump copy buffer size to 256k by default

This is small enough that it shouldn't cause problems on most machines
we support, but big enough to increase throughput on a lot of devices
and network protocols.

Note that the actual value is 256k minus malloc overhead, so that it
fits nicely in a 256k block (as suggested by Alexander Larsson).

See https://bugzilla.gnome.org/show_bug.cgi?id=773632

https://bugzilla.gnome.org/show_bug.cgi?id=773823
This commit is contained in:
Bastien Nocera 2016-11-02 11:58:14 +01:00
parent 0106a6cd9e
commit 3b5b5696ed

View File

@ -2765,7 +2765,8 @@ g_file_copy_attributes (GFile *source,
return res;
}
#define STREAM_BUFFER_SIZE (1024*64)
/* 256k minus malloc overhead */
#define STREAM_BUFFER_SIZE (1024*256 - 2 *sizeof(gpointer))
static gboolean
copy_stream_with_progress (GInputStream *in,