PackObjectsHookWithSidechannel: buffer stdout data
PackObjectsHookWithSidechannel can sometimes show stuttering behavior, where small writes from 'git pack-objects' becomes small writes into the cache, small reads from the cache, small network sends, small network receives, and small pipe writes. If we make the initial writes bigger then each successive read and write down the chain gets bigger too.
This change adds buffering for the stdout stream of PackObjectsHookWithSidechannel. This also applies to PackObjectsHook.
In the small experiment below this saves 15% CPU across gitaly
and gitaly-hooks
. Real life savings will depend on the data in the repository, how it's compressed, and which data the user is fetching.
No buffering:
With buffering:
Edited by Jacob Vosmaer