git/xdiff
Niels Glodny 03f2915541 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>
2025-04-29 12:46:58 -07:00
..
xdiff.h xdiff: *.txt -> *.adoc fixes 2025-03-03 13:49:27 -08:00
xdiffi.c xdiff: avoid using the comma operator unnecessarily 2025-03-28 17:38:10 -07:00
xdiffi.h
xemit.c Merge branch 'rs/xdiff-context-length-fix' 2025-03-29 16:39:10 +09:00
xemit.h
xhistogram.c
xinclude.h
xmacros.h
xmerge.c
xpatience.c xdiff: *.txt -> *.adoc fixes 2025-03-03 13:49:27 -08:00
xprepare.c xdiff: disable cleanup_records heuristic with --minimal 2025-04-29 12:46:58 -07:00
xprepare.h
xtypes.h
xutils.c xdiff: avoid signed vs. unsigned comparisons in xutils.c 2025-02-12 09:41:17 -08:00
xutils.h