You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm trying out this project to help me orchestrate agent work async so I can scale my output and we have a very large git repo. I was noticing 70s+ delays in viewing diffs for task run code changes. I've used claude to help me dig into the implementation and have a changeset I can share that takes that time down to ~0.5s (136x speed up). Here is a commit you can look at to see what I did.
Note: I don't have good internal understanding of the project so I have low context on whether this approach is backwards compatible (I did have claude analyze this). Really appreciate the hard work the team has put into this!
Here is an analysis from claude on the change:
Performance Optimization: Git Diff Operation
Issue Identified
The application was experiencing severe performance issues when viewing diffs, with loading times exceeding one minute. Investigation revealed that the bottleneck was in the diff_status method in git_cli.rs, specifically the git add -A operation which was taking 70-75 seconds to complete on large repositories.
Root Cause
The original implementation used a temporary Git index and executed git add -A to stage all files before computing diffs. This approach is inefficient for large repositories as it processes all files regardless of whether they've changed.
Solution Implemented
Replaced the expensive git add -A operation with a targeted approach that only adds changed files:
Use git status --porcelain to identify which files have actually changed
Parse the status output to extract file paths
Add only the changed files to the Git index in batches of 100
Properly handle renamed files by extracting both old and new paths
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm trying out this project to help me orchestrate agent work async so I can scale my output and we have a very large git repo. I was noticing 70s+ delays in viewing diffs for task run code changes. I've used claude to help me dig into the implementation and have a changeset I can share that takes that time down to ~0.5s (136x speed up). Here is a commit you can look at to see what I did.
Note: I don't have good internal understanding of the project so I have low context on whether this approach is backwards compatible (I did have claude analyze this). Really appreciate the hard work the team has put into this!
Here is an analysis from claude on the change:
Performance Optimization: Git Diff Operation
Issue Identified
The application was experiencing severe performance issues when viewing diffs, with loading times exceeding one minute. Investigation revealed that the bottleneck was in the
diff_statusmethod ingit_cli.rs, specifically thegit add -Aoperation which was taking 70-75 seconds to complete on large repositories.Root Cause
The original implementation used a temporary Git index and executed
git add -Ato stage all files before computing diffs. This approach is inefficient for large repositories as it processes all files regardless of whether they've changed.Solution Implemented
Replaced the expensive
git add -Aoperation with a targeted approach that only adds changed files:git status --porcelainto identify which files have actually changedResults
This optimization is especially beneficial for large repositories, where the
git add -Aoperation was scanning and processing all files unnecessarily.Beta Was this translation helpful? Give feedback.
All reactions