Checking push size is inefficient without quarantine directory
In the best case, we're able to determine push size via the quarantine directory. If we can't, then we have to resort to a graph walk to determine which objects are new. While this is already inperformant by itself (even though we cannot change it), we perform the computation per reference. This is even worse given that for each changed reference, we'll have to re-walk the complete revision graph. The check thus scales both with repository size and with the number of changed refs, which is kind of the worst case that can happen.
We should optimize the check to compute all blobs in a single RPC ("git rev-list --objects --not --all --not $REVS..."). Gitaly does not yet have an RPC to implement this, so it needs some work in Gitaly first.
Edited by Patrick Steinhardt