git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] xdiff: disable cleanup_records heuristic with --minimal

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2025, 22:50 UTC
Message-ID
<xmqq4ixxfj6t.fsf@gitster.g>
In-Reply-To
<f2b34e81-fb86-4a30-9aa7-67e6f5758168@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 27 quoted lines
> 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.
Previous: Phillip Wood
Message 9 of 9 in “xdiff: disable cleanup_records heuristic with --minimal”
  1. xdiff: disable cleanup_records heuristic with --minimalNiels Glodny, Apr 25, 2025
  2. Phillip WoodApr 27, 2025
  3. Niels GlodnyApr 27, 2025
  4. Junio C HamanoApr 28, 2025
  5. xdiff: disable cleanup_records heuristic with --minimalNiels Glodny, Apr 27, 2025
  6. Phillip WoodApr 29, 2025
  7. xdiff: disable cleanup_records heuristic with --minimalNiels Glodny, Apr 29, 2025
  8. Phillip WoodMay 6, 2025
  9. Junio C HamanoMay 6, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.