diff options
author | Niels Glodny <n.glodny@campus.lmu.de> | 2025-04-29 16:09:49 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-04-29 12:46:58 -0700 |
commit | 03f2915541a4923c5733e505a42e77031eb9494c (patch) | |
tree | 057bd2a3298a0e178944fe2a8b558f327b9039b1 /commit-graph.c | |
parent | f65182a99e545d2f2bc22e6c1c2da192133b16a3 (diff) |
xdiff: disable cleanup_records heuristic with --minimal
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.
Signed-off-by: Niels Glodny <n.glodny@campus.lmu.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions