UwDiff benchmarks (with conditions, losses included)

The UwView series — search with UwView, compare with UwDiff

Compare two files or two folders with UwDiff; open and search huge files with UwView. Both run on Windows, macOS and Linux. → UwView benchmarks

UwDiff benchmarks (1.0.0)

Measurements of UwDiff (the uvd CLI and the GUI) on files up to 10 GB × 2. Every time was taken after confirming that the result matches the expected answer exactly. Source: docs/benchmarks.md on GitHub.
[Back to UwDiff]

The short version: key matching of two 10 GB CSV files takes 20.5 to 23.3 s and two 10 GB text files take 20.7 s — but the worst case, where almost every line differs, takes 110 s, and a tight memory limit takes 58 to 60 s

Losses and limits first.

  • Text where almost every line differs — the worst case (two 10 GB files, the new one shuffled every 4,096 lines) took 110 s and 1.3 GiB, about five times the 20.7 s for files whose lines are in order.
  • Huge tables in shuffled row order keep rows waiting for their counterpart in memory (11.1 to 11.5 GiB for two 10 GB files). With the memory limit at 476 MB they spill to temporary files and the run completes, but takes 58 to 60 s.
  • Where millions of lines are rearranged in one place, that range may be reported as a replacement (a correct diff, but not necessarily the minimal one).
  • The cache was not cleared for any value on this page (runs directly after generating the data). Two 10 GB files do not fit in memory, so those runs are close to cold; the 1 GB runs may have been served from the cache.

Environment

  • Mac mini (Apple M4, 10 cores, 32 GB memory), macOS, data on an external SSD
  • uvd 1.0.0 (.NET 10). Seconds are /usr/bin/time real; memory is maximum resident set size
  • Rules: state the machine and storage / never compare seconds across OSes / differences under 1.5x are reported as “level”
  • This page does not include comparisons with other diff tools.

Test data

The same data as tools/run_tests.sh (generated by tools/testdata/uwdiff_gen2.c with a fixed seed). CSV columns: point name, X, Y, Z, type, station number, observation date, note. The new file is derived from the old one with deletions, insertions, edits (1 to 7 cells per row, all columns, value to empty and empty to value), runs of consecutive rows (1 to 128), renamed keys and line breaks inside quotes.

Row order of the new file: keep (same as old), local (shuffled every 4,096 rows) and shuffle (fully shuffled). Encodings: UTF-8 (LF) and CP932 (CRLF).

Size Rows in old Rows in the expected diff
1 GB 10.53 million 257,000
10 GB 105.34 million 2.559 million

Tables, key matching (uvd OLD NEW -key point_name -o diff.csv)

Size × 2 Row order UTF-8 (s) CP932 (s) Memory
1 GB keep / local / shuffle 2.1 / 1.2 / 1.2 2.1 / 1.2 / 1.3 1.4 to 2.1 GiB
10 GB keep 21.8 20.5 4.0 to 4.3 GiB
10 GB local 21.8 12.9 (*) 3.6 to 4.2 GiB
10 GB shuffle 23.3 22.3 11.1 to 11.5 GiB
10 GB shuffle, memory limit 476 MB (spills to temporary files) 58 60 2.8 GiB

(*) The data generated just before was still in the cache.

Text (uvd OLD NEW -o changes.diff, unified diff)

Size × 2 Row order Time (s) Memory Diff lines (removed / added)
1 GB keep 1.7 0.36 GiB 128,000 / 128,000
10 GB keep 20.7 0.4 GiB 1.27 million / 1.27 million
10 GB local (worst case, almost every line differs) 110 1.3 GiB 106.31 million / 106.31 million

Correctness: applying the produced diff to the old file reproduces the new file byte for byte, confirmed at 10 GB as well.

GUI (UwDiff)

Comparison From Compare until on screen (s) Jump to the last change
Text 10 GB × 2 (keep, 1.16 million changes) 20.5 27 ms

Many files (uvd OLD_DIR NEW_DIR -o list.csv)

Folders Time (s)
10,000 files, 2.2 GB per side (about 1% different, 10 files only in old / only in new) 3.1 (data in the page cache)

Reproducing

DATA=<test data location> tools/run_tests.sh 1GB 10GB

The 10 GB test data alone takes about 90 GB. Source and test tools are in the UwDiff repository on GitHub.


From the developer: a list of my apps, Kindle books and public projects is on GitHub: amru195704.

Copied title and URL