summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2026-03-02 21:17:04 +0200
committerJunio C Hamano <gitster@pobox.com>2026-03-02 16:00:43 -0800
commit005f3fbe07a20dd5f7dea57f6f46cd797387e56a (patch)
tree156f66d232c8e3a28110ea9171d927a9edcda12a /contrib/persistent-https
parentb5e9ad508c2f340bd2d2547d7370ae7ac6a0d65d (diff)
downloadgit-005f3fbe07a20dd5f7dea57f6f46cd797387e56a.tar.gz
git-005f3fbe07a20dd5f7dea57f6f46cd797387e56a.zip
builtin/receive-pack: avoid spinning no-op sideband async threads
Exit early if the hooks do not exist, to avoid spinning up/down sideband async threads which no-op. It is important to call the hook_exists() API provided by hook.[ch] because it covers both config-defined hooks and the "traditional" hooks from the hookdir. find_hook() only covers the hookdir hooks. The regression happened because the no-op async threads add some additional overhead which can be measured with the receive-refs test of the benchmarks suite [1]. Reproduced using: cd benchmarks/receive-refs && \ ./run --revisions /path/to/git \ fc148b146ad41be71a7852c4867f0773cbfe1ff9~,fc148b146ad41be71a7852c4867f0773cbfe1ff9 \ --parameter-list refformat reftable --parameter-list refcount 10000 1: https://gitlab.com/gitlab-org/data-access/git/benchmarks Fixes: fc148b146ad4 ("receive-pack: convert update hooks to new API") Reported-by: Patrick Steinhardt <ps@pks.im> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> [jc: avoid duplicated hardcoded hook names] Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions