Skip to content

test(replay): optimize runtime performance#62

Merged
bmwill merged 2 commits intobmwill:masterfrom
weihanglo:replay-optimize
Apr 13, 2026
Merged

test(replay): optimize runtime performance#62
bmwill merged 2 commits intobmwill:masterfrom
weihanglo:replay-optimize

Conversation

@weihanglo
Copy link
Copy Markdown
Contributor

@weihanglo weihanglo commented Apr 13, 2026

  1. Use stdout pipe to avoid thousands of forc-exec over git ls-tree and git show.
  2. Combine --raw and --numstat into single git call

Benchmark result for full history replay (on 96-cores Linux host):

Repo master this Speedup
rust-lang/cargo 59.40s 5.61s 10.6×
rust-lang/rust 1682.06s 101.66s 16.5×
python/cpython 439.20s 106.31s 4.1×

On macOS M1 10 cores mahchine:

Repo master this Speedup
bmwill/diffy (full) 34.01s 8.91s 3.8×
rust-lang/cargo (200) 96.22s 11.58s 8.3×

So we use stdout pipe to avoid thousands of forc-exec over
`git ls-tree` and `git show`.

Benchmark result for Apple M1 Pro (10 cores):

| Repo                  | Before | After  | Speedup |
|-----------------------|-------:|-------:|--------:|
| bmwill/diffy (full)   | 31.76s | 11.06s |    2.9× |
| rust-lang/cargo (200) | 93.04s | 14.60s |    6.4× |
Reduces subprocess count from 3 to 2 per commit pair.

Benchmark result for full history replay (on 96-cores Linux host):

| Repo            | master   | this    | Speedup |
|-----------------|----------|---------|---------|
| rust-lang/cargo |   59.40s |   5.61s |  10.6×  |
| rust-lang/rust  | 1682.06s | 101.66s |  16.5×  |
| python/cpython  |  439.20s | 106.31s |   4.1×  |

On macOS M1 10 cores mahchine:

| Repo                  | master | this   | Speedup |
|-----------------------|-------:|-------:|--------:|
| bmwill/diffy (full)   | 34.01s |  8.91s |    3.8× |
| rust-lang/cargo (200) | 96.22s | 11.58s |    8.3× |
@weihanglo weihanglo changed the title test(replay): optimize replay test runtime performance test(replay): optimize runtime performance Apr 13, 2026
@bmwill bmwill merged commit 3545dae into bmwill:master Apr 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants