[glib] gio: Bump copy buffer size to 256k by default
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gio: Bump copy buffer size to 256k by default
- Date: Wed, 11 Jan 2017 17:26:31 +0000 (UTC)
commit 3b5b5696ed121ef6ff48fd076fccf95053db33a7
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 2 11:58:14 2016 +0100
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 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/gfile.c b/gio/gfile.c
index 218d9af..af0587b 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]