-
Couldn't load subscription status.
- Fork 22
[FEAT][LSP] Worktrees #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c595a7a
getting worktree to work in both lsp and normal cli mode
mohammedahmed18 b955ad8
worktrees changes
mohammedahmed18 4e3f9ec
revert sentry
mohammedahmed18 50df6d7
patch new line
mohammedahmed18 e32e93f
fixes
mohammedahmed18 ff78ce3
fixes
mohammedahmed18 203002d
fix console.quiet issue
mohammedahmed18 d041dfb
fix: quite console in lsp mode
mohammedahmed18 6a7da80
Merge branch 'main' into feat/detached-worktrees
Saga4 d8eb121
return the best explanation from the lsp optimization feature
mohammedahmed18 b6d6d40
Merge branch 'main' of github.com:codeflash-ai/codeflash into feat/de…
mohammedahmed18 6fb1544
Merge branch 'feat/detached-worktrees' of github.com:codeflash-ai/cod…
mohammedahmed18 48d6ccd
delimiter for lsp server logs
mohammedahmed18 e33ff21
merge main
mohammedahmed18 22b5065
Merge branch 'main' of github.com:codeflash-ai/codeflash into feat/de…
mohammedahmed18 9c41957
small fixes
mohammedahmed18 8b74abd
unnecessarily message log
mohammedahmed18 1500869
fix: ignore white spaces when applying temp patch to the detached wor…
mohammedahmed18 bdf1770
feat: optimize current diff
mohammedahmed18 32099b4
fixes and getting the worktree to work with PR and staging
mohammedahmed18 6e619aa
comment
mohammedahmed18 7fccd60
fix linting issue
mohammedahmed18 8addeb3
Merge branch 'main' into feat/detached-worktrees
mohammedahmed18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +0,0 @@ | ||
| # Silence the console module to prevent stdout pollution | ||
| from codeflash.cli_cmds.console import console | ||
|
|
||
| console.quiet = True | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡️Codeflash found 8,048% (80.48x) speedup for
generate_candidatesincodeflash/code_utils/coverage_utils.py⏱️ Runtime :
162 milliseconds→1.99 milliseconds(best of365runs)📝 Explanation and details
The optimized code achieves a 81x speedup by eliminating expensive Path object operations in the main loop. The key optimization replaces the original approach that repeatedly calls
current_path.parentand constructsPath(current_path.name) / last_addedobjects with a more efficient strategy usingsource_code_path.parts.Key Changes:
.parentcalls, the code extracts all path components once usingsource_code_path.partsstr(Path(current_path.name) / last_added)operation (96% of original runtime) is replaced with simple string formattingf"{parts[i]}/{last_added}"while current_path != current_path.parentloop is replaced with aforloop that iterates through pre-computed partsWhy This Is Faster:
parts[i]) is faster than repeated method calls (.parent)Performance Characteristics:
The optimization shows excellent scaling - deeper directory structures see greater speedups (up to 104x faster for 1000-level nesting). All test cases benefit significantly, with the smallest improvement being 30% for simple cases and massive gains of 8000%+ for deeply nested paths.
✅ Correctness verification report:
⚙️ Existing Unit Tests and Runtime
test_code_utils.py::test_generate_candidates🌀 Generated Regression Tests and Runtime
🔎 Concolic Coverage Tests and Runtime
codeflash_concolic_9d591alw/tmpkrdmrlwv/test_concolic_coverage.py::test_generate_candidatesTo test or edit this optimization locally
git merge codeflash/optimize-pr649-2025-08-14T13.45.27