diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-05-28 11:23:46 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-05-28 18:38:07 +0900 |
| commit | fef381e6dcbc328c4ccabaf4e8d4cdf19d1aba00 (patch) | |
| tree | 9632ebec360b77af28e9bcf33d3e585c97ccea71 /builtin/commit-tree.c | |
| parent | send-email: lazily load config for a big speedup (diff) | |
| download | git-fef381e6dcbc328c4ccabaf4e8d4cdf19d1aba00.tar.gz git-fef381e6dcbc328c4ccabaf4e8d4cdf19d1aba00.zip | |
send-email: lazily shell out to "git var"
Optimize git-send-email by only shelling out to "git var" if we need
to. This is easily done by re-inventing our own small version of
perl's Memoize module.
I suppose I could just use Memoize itself, but in a subsequent patch
I'll be micro-optimizing send-email's use of dependencies. Using
Memoize is a measly extra 5-10 milliseconds, but as we'll see that'll
end up mattering for us in the end.
This brings the runtime of a plain "send-email" from around ~160-170ms
to ~140m-150ms. The runtime of the tests is around the same, or around
~20s.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-tree.c')
0 files changed, 0 insertions, 0 deletions
