On Tue, Mar 09, 2021 at 03:48:40PM -0800, Junio C Hamano wrote: > "Jeff Hostetler via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > > > + /* > > + * Write the header and the buffer in 2 parts so that we do not need > > + * to allocate a buffer or rely on a static buffer. This avoids perf > > + * and multi-threading issues. > > + */ > > I understand "multi-threading issues" (i.e. let's not have too much > stuff on the stack), but what issue around "perf" are we worried > about? > > Even though we eliminate memcpy() from the original buffer to our > temporary, this doubles the number of write(2) system calls used to > write out packetised data, by the way. I do not know if this results > in measurable performance degradation, but hopefully we can fix it > locally if it turns out to be a real problem later. Yeah, this came from my suggestion. My gut feeling is that it isn't likely to matter, but I'd much rather solve any performance problem we find using writev(), which would be pretty easy to emulate with a wrapper for systems that lack it. -Peff