Re: [PATCH 0/9] send-email: various optimizations to speed up by >2x
- From
Jeff King <peff@peff.net>
- Date
- May 12, 2021, 23:36 UTC
- Message-ID
- <YJxmmyM9/3KBFPTg@coredump.intra.peff.net>
- In-Reply-To
- <cover-0.9-0000000000-20210512T132955Z-avarab@gmail.com>
On Wed, May 12, 2021 at 03:48:16PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> As noted in the subject this speeds up git-send-email invocations by > ~2x or more, and brings the very slow t9001 test from running in ~26s > on my box to ~12s. It's no longer consistently the slowest test I run. > > This is basically done in two ways: We lazily invoke "git config" to > get config, before it's very eager, and deferring Perl compilation > with s/use/require/g.
Splitting my reply, since the other one got deep into test-suite timing details.
The techniques here look overall pretty reasonable. I think the module lazy-loading makes the overall code a _little_ uglier, but IMHO the speedup you're getting is worth it (I was surprised how much of the improvement comes from that versus avoiding git-config subprocesses).
My only concern is changing the interface of Git::config_regexp() in the final patch. Do we need to have a config_regexp_with_values() to avoid breaking third-party users of the module?
-Peff