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]

In charts: compared with other tools (same Mac, up to 10 GB)

UwDiff, qsv, DuckDB, GNU diff and macOS diff, measured on the same Mac with the same test data, clearing the cache before every run (every diff matched the expected answer). Conditions and all the numbers are under “Compared with other tools” below.

Time to compare two files at 1 GB, 5 GB and 10 GB, shortest first in each box; UwDiff is the shortest in every box. Table key match, rows in order: UwDiff 2.3 / 10.9 / 21.5 s, qsv 2.7 / 17.1 / 32.6 s, DuckDB 4.0 / 23.3 / 124.7 s. Rows shuffled: UwDiff 2.3 / 11.1 / 22.6 s, DuckDB 4.4 / 24.4 / 220.1 s, qsv 5.9 / 36.0 s and stopped at 10 minutes at 10 GB. Text comparison: UwDiff 2.4 / 10.7 / 21.2 s, GNU diff 8.2 / 41.2 / 150.9 s, macOS diff 11.0 / 96.8 / 289.2 s.

Time relative to UwDiff = 1 at 10 GB. Table, rows in order: qsv 1.5×, DuckDB 5.8×. Rows shuffled: DuckDB 9.7×, qsv stopped (over 26.5×). Text: GNU diff 7.1×, macOS diff 13.6×.

Size and time. Table key match, rows shuffled, CP932: UwDiff 2.2, 10.6, 21.9 s, in proportion to size; DuckDB 11.7, 60.7, 357.9 s (31× the 1 GB time); qsv 5.9, 35.8 s and stopped at 10 GB. Text comparison, UTF-8: UwDiff 2.4, 10.7, 21.2 s; GNU diff 8.2, 41.2, 150.9 s (18×); macOS diff 11.0, 96.8, 289.2 s (26×).

  • At 10× the size, UwDiff takes about 10× as long (in proportion to size). The other tools take 18–31× as long, growing faster than the size (qsv passed 10 minutes at 10 GB with rows shuffled).
  • For tables with rows in order, the gap to qsv is 1.5×, right at the line we count as “on par”.

The same scaling story as a video (about 3 minutes; open on YouTube):

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

  • MacBook Air (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)

Compared with other tools

What each tool can do (features)

UwDiff 1.0.0 Beyond Compare 5 qsv diff DuckDB GNU diff macOS diff
GUI ✓ ✓ ✗ (GUI is the separate qsv pro) △ (DuckDB UI, a window for writing SQL) ✗ ✗
CLI ✓ uvd ✓ bcomp (scripts) ✓ ✓ (SQL) ✓ ✓
Send CLI results straight to the GUI ✓ uvd … -open — — — — —
OS Windows, macOS, Linux Windows, macOS, Linux Windows, macOS, Linux Windows, macOS, Linux Linux, macOS and others macOS only
Encodings Detected automatically (UTF-8, Shift-JIS/CP932, EUC-JP, UTF-16); old and new may differ Chosen by hand; errors on CP932 characters such as ① and 髙 (measured) Expects UTF-8 (compares bytes as they are) UTF-8, UTF-16, Latin-1; others via an extension, named by hand Compares bytes as they are Compares bytes as they are
Tables matched by key columns (row order may differ) ✓ (CSV, TSV, Excel) ✓ (Table Compare) ✓ ✓ (you write the SQL) ✗ ✗
Text compared in order (unified diff) ✓ ✓ ✗ ✗ ✓ ✓
Folder vs folder ✓ ✓ ✗ ✗ ✓ (-r) ✓ (-r)
Inside compressed files 7 formats (gz, bz2, xz, lzma, zst, lz4, br) gz, bz2, xz, zip, 7z and more (opened as archives) Snappy gzip, zstd ✗ (separate commands such as zdiff) ✗
Word, Excel, PDF ✓ (docx and pdf as text, xlsx as tables) ✓ read-only (Word and PDF converted to text; Excel needs Excel installed; the official notes are for Windows) Exports xlsx/ods to CSV (excel command) Reads xlsx (read_xlsx) ✗ ✗
Apply only the changes you pick ✓ (keeps the old file’s encoding, delimiter, line endings and quoting) ✓ (copy rows or cells in the GUI) ✗ Write your own SQL patch applies all patch applies all
10 GB × 2 (measured below) ✓ tables 20–23 s, text 21 s ✗ (tables passed 20 min at 100 MB) ✓ with rows in order (33 s); shuffled did not finish in 10 min ✓ (tables 2–6 min) ✓ text 118–151 s, about 17–19 GiB of memory ✓ text 280–289 s, about 26 GiB of memory
  • ✓ means confirmed in the official documentation or in our measurements. Each tool has strengths not listed here (Beyond Compare’s picture/binary comparison and 3-way merge, qsv’s many CSV commands, DuckDB’s analytical SQL, and so on).
  • Sources: Beyond Compare archives, Word/Excel/PDF, command line; qsv; DuckDB CSV, Excel, UI (checked 2026-10-26).

Measured on the same machine (the same MacBook Air and test data as above)

What UwDiff (uvd) Other tool Reading
10,000-file folders, 2.2 GB per side (data in the page cache) 3.1 s diff -rq 3.3 s On par (less than 1.5×)
Size of the text diff (order-preserving comparison) — GNU diff keep: the same or slightly smaller; local: 0.5% larger than GNU diff

Same Mac, same test data (re-measured 2026-10-26)

UwDiff 1.0.0 and the other tools were measured on the same machine, with the same test data and the same method. Every time shown is for a diff that matched the expected answer exactly. The figure in parentheses is how many times longer it took than UwDiff; under 1.5× is reported as “on par”.

Table key matching (uvd OLD NEW -key point_name / qsv diff --key 0 / DuckDB SQL joining on the point name)

Size × 2 Row order Encoding UwDiff 1.0.0 qsv diff 26.0.0 DuckDB 2.0.0
1 GB (10.53 M rows) in order UTF-8 2.28 s 2.73 s (on par) 4.05 s (1.8×)
1 GB in order CP932 2.15 s 2.84 s (on par) 11.39 s (5.3×)
1 GB shuffled UTF-8 2.27 s 5.87 s (2.6×) 4.41 s (1.9×)
1 GB shuffled CP932 2.18 s 5.85 s (2.7×) 11.70 s (5.4×)
5 GB (52.67 M rows) in order UTF-8 10.88 s 17.15 s (1.6×) 23.33 s (2.1×)
5 GB in order CP932 10.24 s 15.65 s (1.5×) 59.67 s (5.8×)
5 GB shuffled UTF-8 11.11 s 36.01 s (3.2×) 24.39 s (2.2×)
5 GB shuffled CP932 10.57 s 35.76 s (3.4×) 60.65 s (5.7×)
10 GB (105.35 M rows) in order UTF-8 21.52 s 32.56 s (1.5×) 124.66 s (5.8×)
10 GB in order CP932 20.35 s 32.56 s (1.6×) 188.34 s (9.3×)
10 GB shuffled UTF-8 22.61 s not finished in 10 min, stopped 220.06 s (9.7×)
10 GB shuffled CP932 21.90 s not finished in 10 min, stopped 357.91 s (16.3×)

Text comparison (unified diff, order-preserving, rows in order): time and memory

Size × 2 Encoding UwDiff 1.0.0 GNU diff 3.12 (diff -u) macOS diff (diff -u)
1 GB UTF-8 2.37 s, 0.31 GiB 8.24 s (3.5×), 3.15 GiB 11.00 s (4.6×), 2.87 GiB
1 GB CP932 2.23 s, 0.29 GiB 8.50 s (3.8×), 3.04 GiB 10.70 s (4.8×), 2.76 GiB
5 GB UTF-8 10.74 s, 0.41 GiB 41.24 s (3.8×), 13.78 GiB 96.82 s (9.0×), 14.39 GiB
5 GB CP932 9.86 s, 0.39 GiB 42.77 s (4.3×), 13.21 GiB 86.98 s (8.8×), 13.82 GiB
10 GB UTF-8 21.23 s, 0.41 GiB 150.93 s (7.1×), 17.23 GiB 289.24 s (13.6×), 25.86 GiB
10 GB CP932 20.77 s, 0.41 GiB 117.92 s (5.7×), 18.54 GiB 279.68 s (13.5×), 26.19 GiB
  • Diff size: UwDiff’s diff is slightly smaller (at 10 GB: UwDiff 2.547 million lines, GNU diff 2.565 million, macOS diff 2.566 million). For all three, applying the diff to the old file reproduces the new file byte for byte.
  • Memory (table key matching, 10 GB): rows in order — UwDiff 4.2–4.5 GiB, qsv 1.7–2.1 GiB (qsv uses less), DuckDB about 18 GiB. Rows shuffled — UwDiff 12.7–13.4 GiB, DuckDB 20–21 GiB; qsv had reached about 18 GiB when it was stopped. With a memory cap, UwDiff spills to temporary files and still finishes (see “memory capped at 476 MB” above).
  • Losses and ties included: with rows in order, qsv is on par with UwDiff at 1 GB and takes 1.5–1.6× at 5 and 10 GB, and it uses less memory at every size.
  • Conditions: MacBook Air (Apple M4, 10 cores, 32 GB), macOS 26.3.1, data on an external USB SSD. Test data made the same way as under “Test data” above (version 2; keep = in order, shuffle = shuffled; UTF-8 (LF) and CP932 (CRLF)). Cache cleared before every run (sudo purge), one run each. Seconds are /usr/bin/time real; memory is maximum resident set size. uvd 1.0.0 (build 26.10.25.20, the released build); runs over 10 minutes were stopped.
  • The measuring script is tools/bench_compare_mac.sh in the UwDiff repository.

Beyond Compare and Excel (2026-10-23, the same MacBook Air, different test data; for reference)

  • Beyond Compare 5.2.6 (Table Compare, with a key): 100,000 rows (10 MB) in about 145 s; 526,000 rows (50 MB) in 16 min 18 s (counts matched). 1.05 million rows (100 MB) did not finish in 20 min and was stopped. CP932 is not detected; even with Shift-JIS chosen by hand it errors on characters such as ① and 髙.
  • Excel (Mac): truncates at 1,048,576 rows and turns 1-10 into a date.

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.

(Japanese) UwDiff magazine on note: 巨大ファイルを比べる——UwDiff 開発と使い方


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

Copied title and URL