-
Notifications
You must be signed in to change notification settings - Fork 22
Simple docs update #1178
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
Open
mashraf-222
wants to merge
2
commits into
main
Choose a base branch
from
simple-update-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Simple docs update #1178
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,20 +65,11 @@ The **Optimization** tab is your main interface for selecting code to optimize. | |
|
|
||
|  | ||
|
|
||
| At the top of the Optimization tab, you'll find two dropdown selectors: | ||
| At the top of the Optimization tab, you'll find: | ||
|
|
||
| 1. **FILE** — Select a Python file from your workspace | ||
|
|
||
| - Click the dropdown to browse and select a Python file | ||
| - The placeholder shows "Select a Python file" until you make a selection | ||
|
|
||
| 2. **FUNCTION/METHOD** — Select a specific function to optimize | ||
|
|
||
| - This dropdown is disabled until you select a file first | ||
| - Once a file is selected, it populates with all optimizable functions (qualified names) | ||
| - Functions are displayed with their fully qualified names (e.g., `MyClass.my_method` or `module.function_name`) | ||
|
|
||
| 3. **Optimize Button** — Click the **Optimize** button (with lightning bolt icon) to queue the selected function for optimization | ||
| 1. **FILE** — pick a Python file from your workspace. | ||
| 2. **FUNCTION/METHOD** — pick a specific function or method in that file. | ||
| 3. **Optimize** — click the lightning button to queue that function for optimization. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add a lightning button emoji here |
||
|
|
||
| <Info> | ||
| **Qualified Names** — Functions are displayed with their fully qualified | ||
|
|
@@ -123,93 +114,16 @@ When you first open the Optimization tab, you'll see a "Ready to Optimize" secti | |
|
|
||
| --- | ||
|
|
||
| ## Tasks Tab | ||
|
|
||
| The **Tasks** tab shows your optimization queue and completed optimizations. Switch to this tab to: | ||
|
|
||
| - View all queued optimizations | ||
| - Track progress of running optimizations | ||
| - Review completed optimizations | ||
|
|
||
| ### Empty State | ||
|
|
||
| When you haven't started any optimizations yet, the Tasks tab shows: | ||
|
|
||
| - A rocket icon | ||
| - "No optimizations yet" message | ||
| - Instructions: "Add functions to the queue by clicking the small optimize button above a function" | ||
|
|
||
| ### Completed Optimizations | ||
|
|
||
| Once optimizations complete, you'll see a list showing: | ||
|
|
||
|  | ||
| - **Function Name** — The name of the optimized function | ||
| - **Status Badge** — Shows completion status with speedup information: | ||
| - "Completed (Xx Faster)" — Displays the performance improvement | ||
| - Example: "Completed (2.5x Faster)" or "Completed (Speedup: 338.66x Faster)" | ||
| - **Optimization Quality** — Some optimizations show quality ratings (e.g., "Optimization Quality: High") | ||
| - **Actions:** | ||
| - **View Optimization** button — Opens the diff view to see changes and apply them | ||
| - **View PR** button — Opens the associated pull request (if optimization was created via PR) | ||
|
|
||
| <Info> | ||
| The Tasks tab shows a badge count (e.g., "Tasks 19") indicating how many | ||
| optimization tasks you have in total. | ||
| </Info> | ||
|
|
||
| --- | ||
|
|
||
| ## Optimization Workflow | ||
|
|
||
| Once you've selected functions to optimize (via any method above), here's what happens: | ||
|
|
||
| <Steps> | ||
| <Step title="Queue Optimization"> | ||
| Selected functions are added to the optimization queue. You can see them in | ||
| the Tasks tab. | ||
| </Step> | ||
| <Step title="Track Progress"> | ||
| Watch the Tasks tab for real-time updates: - Generating optimization | ||
| candidates - Running tests to verify correctness - Benchmarking performance | ||
| </Step> | ||
| <Step title="Review Results"> | ||
| When complete, you'll see the optimization in the Tasks tab with: - Speedup | ||
| information (e.g., "2.5x Faster") - Optimization quality rating - **View | ||
| Optimization** button to see the diff | ||
| </Step> | ||
| <Step title="Apply Changes"> | ||
| Click **View Optimization** to see the full diff, then **Accept** to apply | ||
| the optimization, or **Reject** to dismiss it. | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| --- | ||
|
|
||
| ## Reviewing Optimizations | ||
|
|
||
| After an optimization completes, you can review it in the Tasks tab or via inline comments. | ||
|
|
||
|  | ||
|
|
||
| ### In the Tasks Tab | ||
|
|
||
| Click **View Optimization** on any completed optimization to see: | ||
|
|
||
| - Side-by-side comparison of original vs. optimized code | ||
| - Performance improvement percentage (speedup) | ||
| - Runtime comparison (original vs. optimized) | ||
| - Optimization quality rating | ||
| - Detailed explanation of what changed and why | ||
| - **Apply Optimization** button to accept the changes | ||
| ## Tasks Tab and reviewing optimizations | ||
|
|
||
| ### Inline Comments | ||
| The **Tasks** tab shows your optimization queue and completed optimizations. You can: | ||
|
|
||
| The extension also shows inline comments on the optimized function in your editor with options to: | ||
| - See which functions are queued or running | ||
| - Inspect completed optimizations, including speedup and quality | ||
| - Open the related PR (when the optimization was created via PR) | ||
|
|
||
| - **View Patch** — See the full diff of changes | ||
| - **Accept** — Apply the optimization to your code | ||
| - **Reject** — Dismiss the suggestion without changes | ||
| Click **View Optimization** on any completed item to see the diff and explanation, then apply or reject the changes. | ||
| You will also see inline comments on optimized functions in the editor with actions to **View Patch**, **Accept**, or **Reject**. | ||
|
|
||
| --- | ||
|
|
||
|
|
||
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 |
|---|---|---|
|
|
@@ -176,6 +176,20 @@ codeflash --all # optimize the entire repo | |
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ### Common CLI flags | ||
|
|
||
| For everyday use, these are the most important flags: | ||
|
|
||
| - **`--file PATH`**: Optimize only this file. | ||
| - **`--function NAME`**: Optimize only this function (requires `--file`). | ||
| - **`--all [PATH]`**: Optimize all functions, optionally under a path. | ||
| - **`--no-pr`**: Apply changes locally instead of creating a pull request. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Adding examples for each would be helpful with placeholder I guess. |
||
| - **`--no-gen-tests`**: Use only existing tests, skip test generation. | ||
| - **`--benchmark` / `--benchmarks-root PATH`**: Enable benchmark mode and point to the benchmarks directory. | ||
| - **`--verbose` / `-v`**: Show detailed logs of what Codeflash is doing. | ||
| - **`--verify-setup`**: Run a sample optimization to verify your installation. | ||
| - **`--version`**: Print the Codeflash CLI version. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| <AccordionGroup> | ||
|
|
||
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
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.
here the file which user is looking if its not part of the module path that can cause them strangled.