Skip to content

Add tools for perf analysis#1215

Closed
desiderautumn wants to merge 1 commit into
git-ai-project:mainfrom
desiderautumn:perftools
Closed

Add tools for perf analysis#1215
desiderautumn wants to merge 1 commit into
git-ai-project:mainfrom
desiderautumn:perftools

Conversation

@desiderautumn

@desiderautumn desiderautumn commented Apr 29, 2026

Copy link
Copy Markdown

This commit adds tooling for analyzing the performance overhead of spawning subprocesses. See src/perf/README.md for documentation.

Example output on Linux (of cargo run diff @..f296d):

Time spent in each command:
    /usr/bin/git: 2341 ms (1028 calls)

Time spent in each git subcommand:
    blame: 756 ms (113 calls)
    cat-file: 566 ms (339 calls)
    rev-parse: 344 ms (232 calls)
    notes: 296 ms (227 calls)
    diff: 195 ms (3 calls)
    ls-tree: 183 ms (113 calls)
    show: 1 ms (1 calls)

Total time spent in spawned commands: 2341 ms

Total program time: 3461 ms

Total program time not spent inside commands: 1120 ms (32.36%)

On Windows:

Time spent in each command:
    C:\\Program Files\\Git\\bin\\git.exe: 22890 ms (1028 calls)

Time spent in each git subcommand:
    cat-file: 7451 ms (339 calls)
    rev-parse: 5028 ms (232 calls)
    notes: 4827 ms (227 calls)
    blame: 2745 ms (113 calls)
    ls-tree: 2502 ms (113 calls)
    diff: 314 ms (3 calls)
    show: 23 ms (1 calls)

Total time spent in spawned commands: 22890 ms

Total program time: 24843 ms

Total program time not spent inside commands: 1953 ms (7.86%)

Open in Devin Review

@CLAassistant

CLAassistant commented Apr 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread src/perf/README.md

The `mod.rs` file is a Rust module that wraps the execution of
subprocesses executed via `Command::output` and `Command::status`,
via the `measured_output` and `measured_stats` wrappers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 README typo: measured_stats should be measured_status

The README on line 7 refers to the wrapper as measured_stats, but the actual trait method is named measured_status (as correctly documented on line 12 and implemented in src/perf/mod.rs:13). This will confuse developers trying to use the API based on the README.

Suggested change
via the `measured_output` and `measured_stats` wrappers.
via the `measured_output` and `measured_status` wrappers.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@svarlamov

Copy link
Copy Markdown
Member

@heapwolf See if you'd like to merge or cherry-pick from here for any perf stuff -- esp for Windows. Ideally we can have a harness that would live inside our codebase for easy profiling

@svarlamov svarlamov closed this May 21, 2026
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.

4 participants