On Wed, 17 Feb 2010, Jeff King wrote: > On Wed, Feb 17, 2010 at 05:16:23PM -0800, Junio C Hamano wrote: > > > + if (paranoid) { > > + unsigned char stablebuf[262144]; > > Is 256K a bit big for allocating on the stack? Modern OS's seem to give > us at least a couple of megabytes (my Linux boxen all have 8M, and > even Solaris 8 seems to have that much). But PTHREAD_STACK_MIN is only > 16K (I don't think it is possible to hit this code path in a thread > right now, but I'm not sure). And I have no idea what the situation is > on Windows. > > I dunno if it is worth worrying about, but maybe somebody more clueful > than me can comment. It is likely to have better performance if the buffer is small enough to fit in the CPU L1 cache. There are two sequencial passes over the buffer: one for the SHA1 computation, and another for the compression, and currently they're sure to trash the L1 cache on each pass. Of course that requires big enough objects to matter. Nicolas -- 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