From: Junio C Hamano <gitster@pobox•com>
To: Phillip Wood <phillip.wood123@gmail•com>
Cc: Niels Glodny <n.glodny@campus•lmu.de>,
git@vger•kernel.org, phillip.wood@dunelm•org.uk,
johannes.schindelin@gmx•de, peff@peff•net
Subject: Re: [PATCH v3] xdiff: disable cleanup_records heuristic with --minimal
Date: Tue, 06 May 2025 15:50:02 -0700 [thread overview]
Message-ID: <xmqq4ixxfj6t.fsf@gitster.g> (raw)
In-Reply-To: <f2b34e81-fb86-4a30-9aa7-67e6f5758168@gmail.com> (Phillip Wood's message of "Tue, 6 May 2025 14:21:01 +0100")
Phillip Wood <phillip.wood123@gmail•com> writes:
> Hi Niels
>
> On 29/04/2025 15:09, Niels Glodny wrote:
>> The cleanup_records function marks some lines as changed before running
>> the actual diff algorithm. For most lines, this is a good performance
>> optimization, but it also marks lines that are surrounded by many
>> changed lines as changed as well. This can cause redundant changes and
>> longer-than-necessary diffs.
>> Whether this results in better-looking diffs is subjective. However,
>> the
>> --minimal flag explicitly requests the shortest possible diff.
>> The change results in shorter diffs in about 1.3% of all diffs in
>> Git's
>> history. Performance wise, I have measured the impact on
>> "git log -p -3000 --minimal > /dev/null". With this change, I get
>> Time (mean ± σ): 2.363 s ± 0.023 s (25 runs)
>> and without this patch I measured
>> Time (mean ± σ): 2.362 s ± 0.035 s (25 runs).
>> As the difference is well within the margin of error, this does not seem
>> to have an impact on performance.
>
> Thanks for adding the performance information, this version looks good
> to me.
>
> Best Wishes
>
> Phillip
Yup, thanks, both of you.
prev parent reply other threads:[~2025-05-06 22:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-25 15:59 [PATCH] xdiff: disable cleanup_records heuristic with --minimal Niels Glodny
2025-04-27 15:04 ` Phillip Wood
2025-04-27 21:44 ` Niels Glodny
2025-04-28 17:05 ` Junio C Hamano
2025-04-27 22:06 ` [PATCH v2] " Niels Glodny
2025-04-29 9:00 ` Phillip Wood
2025-04-29 14:09 ` [PATCH v3] " Niels Glodny
2025-05-06 13:21 ` Phillip Wood
2025-05-06 22:50 ` Junio C Hamano [this message]
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=xmqq4ixxfj6t.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=johannes.schindelin@gmx$(echo .)de \
--cc=n.glodny@campus$(echo .)lmu.de \
--cc=peff@peff$(echo .)net \
--cc=phillip.wood123@gmail$(echo .)com \
--cc=phillip.wood@dunelm$(echo .)org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox