diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-05-28 11:23:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-28 18:38:07 +0900 |
commit | f4dc9432fd287bde9100488943baf3c6a04d90d1 (patch) | |
tree | 62e9d43e40f1901413b20c6d48f82943b4c80b39 /reset.c | |
parent | send-email: get rid of indirect object syntax (diff) | |
download | tgif-f4dc9432fd287bde9100488943baf3c6a04d90d1.tar.xz |
send-email: lazily load modules for a big speedup
Optimize the time git-send-email takes to do even the simplest of
things (such as serving up "-h") from around ~150ms to ~80ms-~90ms by
lazily loading the modules it requires.
Before this change Devel::TraceUse would report 99/97 used modules
under NO_GETTEXT=[|Y], respectively. Now it's 52/37. It now takes ~15s
to run t9001-send-email.sh, down from ~20s.
Changing File::Spec::Functions::{catdir,catfile} to invoking class
methods on File::Spec itself is idiomatic. See [1] for a more
elaborate explanation, the resulting code behaves the same way, just
without the now-pointless function wrapper.
1. http://lore.kernel.org/git/8735u8mmj9.fsf@evledraar.gmail.com
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reset.c')
0 files changed, 0 insertions, 0 deletions