On 2016-03-19 02.19, David Turner wrote: > 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@xxxxxxxxxxxxxxxx> > --- > 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; > > Do I read that right, it saves 10 milliseconds ? What happens to small system (like Raspberry PI), when you want 128K write buffer ? Could the buffer size be turned into a makefile variable, defaulting to 8192 ? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html