Skip to content

test(replay): optimize runtime performance - #62

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

bmwill merged 2 commits into
bmwill:masterfrom
weihanglo:replay-optimize

Conversation

@weihanglo

@weihanglo weihanglo commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor
  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
weihanglo added a commit to weihanglo/diffy that referenced this pull request Apr 17, 2026
weihanglo added a commit to weihanglo/diffy that referenced this pull request Apr 17, 2026
weihanglo added a commit to weihanglo/diffy that referenced this pull request Apr 17, 2026
bmwill pushed a commit that referenced this pull request Apr 18, 2026
@weihanglo
weihanglo deleted the replay-optimize branch April 19, 2026 02:12
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