From: Kyle Meyer <kyle@kyleam.com>
To: Jeff King <peff@peff.net>
Cc: Tassilo Horn <tsdh@gnu.org>, Tao Klerks <tao@klerks.biz>,
git@vger.kernel.org
Subject: Re: [BUG?] Major performance issue with some commands on our repo's master branch
Date: Wed, 08 Jun 2022 21:27:43 -0400 [thread overview]
Message-ID: <87sfoe7hio.fsf@kyleam.com> (raw)
In-Reply-To: <YqEyh5opAaJxph2+@coredump.intra.peff.net>
Jeff King writes:
> I suspect the issue may be quite subtle. Even you asked for
> "--no-patch", the underlying diff may still be used for other things.
> For example, simplifying away TREESAME commits. I.e., ones which did not
> change anything from their parents after applying path restrictions,
> diff-filters, etc. There may be other cases, too (e.g., --follow).
>
> I think the code could be written to realize that none of those features
> are in use, and disable the diff entirely in favor of checking whether
> the two trees has the same object id. That would yield _mostly_ the same
> behavior, though there are probably corner cases (e.g., a tree with an
> odd mode entry, say, may get parsed so as to produce an empty diff, even
> though it's not byte for byte identical). That may be an acceptable
> tradeoff. But I think the code would be a bit brittle (it needs to know
> about all the cases where a diff might matter, and we may add more
> later).
Do you think it'd be safe to make --no-patch imply --diff-merges=off, as
Tao suggested elsewhere in this thread?
https://lore.kernel.org/git/CAPMMpog-7eDOrgSU9GjV4G9rk5RkL-PJhaUAO3_0p2YxfRf=LA@mail.gmail.com
If so, it seems like that'd be a good way to get speedups for some merge
commits. For example, here are hyperfine timings for the current tip of
git.git's master branch:
Benchmark #1: git show --no-patch --format=%h 1e59178e3f
Time (mean ± σ): 47.8 ms ± 1.5 ms [User: 43.2 ms, System: 4.6 ms]
Range (min … max): 46.8 ms … 54.4 ms 59 runs
Warning: Statistical outliers were detected. Consider re-running
this benchmark on a quiet PC without any interferences from other
programs. It might help to use the '--warmup' or '--prepare'
options.
Benchmark #2: git show --no-patch --diff-merges=off --format=%h 1e59178e3f
Time (mean ± σ): 3.2 ms ± 0.2 ms [User: 2.5 ms, System: 0.8 ms]
Range (min … max): 2.9 ms … 6.8 ms 688 runs
Warning: Command took less than 5 ms to complete. Results might be
inaccurate.
Warning: Statistical outliers were detected. Consider [...]
options.
Benchmark #3: git log --no-walk --format=%h 1e59178e3f
Time (mean ± σ): 3.2 ms ± 0.1 ms [User: 2.4 ms, System: 0.8 ms]
Range (min … max): 2.9 ms … 4.2 ms 697 runs
Warning: Command took less than 5 ms to complete. Results might [...]
Warning: Statistical outliers were detected. Consider [...]
Summary
'git log --no-walk --format=%h 1e59178e3f' ran
1.01 ± 0.08 times faster than 'git show --no-patch --diff-merges=off --format=%h 1e59178e3f'
14.98 ± 0.79 times faster than 'git show --no-patch --format=%h 1e59178e3f'
next prev parent reply other threads:[~2022-06-09 1:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-04 7:39 [BUG?] Major performance issue with some commands on our repo's master branch Tassilo Horn
2022-06-04 20:20 ` Tao Klerks
2022-06-05 10:46 ` Tassilo Horn
2022-06-06 5:18 ` Tao Klerks
2022-06-08 23:36 ` Jeff King
2022-06-09 1:27 ` Kyle Meyer [this message]
2022-06-09 15:03 ` Jeff King
2022-06-09 18:23 ` Junio C Hamano
2022-06-09 18:43 ` Jeff King
2022-06-09 20:06 ` Junio C Hamano
2022-06-09 5:51 ` Tassilo Horn
2022-06-09 15:05 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfoe7hio.fsf@kyleam.com \
--to=kyle@kyleam.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=tao@klerks.biz \
--cc=tsdh@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.