git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] read-cache: increase write buffer size
@ 2016-03-19  1:19 David Turner
  2016-03-19  8:05 ` Torsten Bögershausen
  2016-03-19 11:18 ` Duy Nguyen
  0 siblings, 2 replies; 5+ messages in thread
From: David Turner @ 2016-03-19  1:19 UTC (permalink / raw)
  To: git; +Cc: David Turner

Each write() has syscall overhead, and writing a large index entails
many such calls.  A larger write buffer reduces the overhead,
leading to increased performance.

On my repo, which has an index size of 30m, this saves about 10ms of
time writing the index.

Signed-off-by: David Turner <dturner@twopensource.com>
---
 read-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/read-cache.c b/read-cache.c
index d9fb78b..09ebe08 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1714,7 +1714,7 @@ int unmerged_index(const struct index_state *istate)
 	return 0;
 }
 
-#define WRITE_BUFFER_SIZE 8192
+#define WRITE_BUFFER_SIZE 131072
 static unsigned char write_buffer[WRITE_BUFFER_SIZE];
 static unsigned long write_buffer_len;
 
-- 
2.4.2.767.g62658d5-twtrsrc

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-21 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-19  1:19 [PATCH] read-cache: increase write buffer size David Turner
2016-03-19  8:05 ` Torsten Bögershausen
2016-03-19 10:25   ` Pranit Bauva
2016-03-19 11:18 ` Duy Nguyen
2016-03-21 16:22   ` David Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).