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

Re: [PATCH 1/2] t4205: compare huge output without diff

From
Jeff King <peff@peff.net>
Date
Sep 25, 2026, 00:13 UTC
Message-ID
<20260925001332.GA1408107@coredump.intra.peff.net>
In-Reply-To
<CAJ-ks9kJWc0e7aEX4vAL-RoJ5kVvfjDABqV86_hZf2Fn-085GA@mail.gmail.com>
On Thu, Sep 24, 2026 at 04:41:05PM -0400, Tamir Duberstein wrote:
Show 10 quoted lines
> > It would be great to back up the claim that test_cmp_bin is better than
> > test_cmp, e.g. by comparing peak RSS and its runtime.
> 
> As for the comparison: on Linux arm64 with GNU
> diffutils 3.8 using two identical files containing 2,147,483,649 "1" bytes
> followed by "0\n" (matching this test's expected output) gave:
> 
> Command              Mean +/- stddev       Maximum RSS (KiB)
> diff -u expect actual  5.276 +/- 0.572 s              4199924
> cmp expect actual      0.506 +/- 0.099 s                 1264

Yeah, that's a big difference. This is probably an outlier because of the giant files, but I've wondered if test_cmp() ought to be doing something like:

  # first check quickly if there is any difference
  cmp "$@" && return 0
  # if not, then we can spend time to produce a useful output
  diff "$@"

But I never pursued it because I figured most of the things we compare are not big enough to matter (and really the comparison itself is dwarfed by the process startup time).

So I am happy just marking this particular case as cmp_bin, too.
-Peff
Previous: Tamir DubersteinNext: Junio C Hamano
Message 5 of 25 in “ci: reduce pressure from large test fixtures”
  1. 0/2 ci: reduce pressure from large test fixturesTamir Duberstein, Sep 23, 2026
  2. 1/2 t4205: compare huge output without diffTamir Duberstein, Sep 23, 2026
  3. Patrick SteinhardtSep 24, 2026
  4. Tamir DubersteinSep 24, 2026
  5. Jeff KingSep 25, 2026
  6. Junio C HamanoSep 25, 2026
  7. Patrick SteinhardtSep 28, 2026
  8. 2/2 ci: match Linux jobs to available CPUsTamir Duberstein, Sep 23, 2026
  9. Patrick SteinhardtSep 24, 2026
  10. Tamir DubersteinSep 25, 2026
  11. Tamir DubersteinSep 23, 2026
  12. 0/2 ci: use cmp and align job-count selectionTamir Duberstein, Sep 25, 2026
  13. 1/2 t4205: compare huge output without diffTamir Duberstein, Sep 25, 2026
  14. Patrick SteinhardtSep 28, 2026
  15. 2/2 ci: align job counts across CI providersTamir Duberstein, Sep 25, 2026
  16. Patrick SteinhardtSep 28, 2026
  17. Tamir DubersteinSep 28, 2026
  18. Patrick SteinhardtSep 28, 2026
  19. 0/2 ci: use cmp and align job-count selectionTamir Duberstein, Sep 30, 2026
  20. 1/2 t4205: compare huge output without diffTamir Duberstein, Sep 30, 2026
  21. 2/2 ci: use twice the CPU count on both providersTamir Duberstein, Sep 30, 2026
  22. Patrick SteinhardtSep 30, 2026
  23. Patrick SteinhardtSep 30, 2026
  24. Tamir DubersteinSep 30, 2026
  25. Junio C HamanoSep 30, 2026

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.