From 3b5b5696ed121ef6ff48fd076fccf95053db33a7 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 2 Nov 2016 11:58:14 +0100 Subject: [PATCH] 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 --- gio/gfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gio/gfile.c b/gio/gfile.c index 218d9af0c..af0587bc7 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -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,