Skip to content

Commit d451f77

Browse files
committed
improve a docs a bit more
1 parent 0273117 commit d451f77

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

docs/docs/intro.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ This is a great way to ensure that your code, your team's code and your AI Agent
2727

2828
<!--- TODO: Add links to the relevant sections of the documentation and style the table --->
2929

30-
| Feature | Description |
31-
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
32-
| [Optimize a single function](optimizing-with-codeflash/one-function) | `codeflash --file path.py --function myfunctionpy` Basic unit of optimization by asking Codeflash to optimize a particular function
33-
| [Optimize an entire workflow](optimizing-with-codeflash/trace-and-optimize) | `codeflash optimize myscript.py` End to end optimization for all the functions called in a workflow, by tracing to collect real inputs to ensure correctness and e2e performance optimization |
34-
| [Optimize all code in a repo](optimizing-with-codeflash/codeflash-all) | `codeflash --all` Codeflash discovers all functions in a repo and optimizes all of them! |
35-
| [Optimize every new pull request](optimizing-with-codeflash/optimize-prs) | `codeflash init-actions` Codeflash runs as a GitHub action and GitHub app and reviews all new code for Optimizations |
30+
| Feature | Usage | Description |
31+
|------------------------------------------------------------------------------|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
32+
| [Optimize a single function](optimizing-with-codeflash/one-function) | `codeflash --file path.py --function my_function` | Basic unit of optimization by asking Codeflash to optimize a particular function |
33+
| [Optimize an entire workflow](optimizing-with-codeflash/trace-and-optimize) | `codeflash optimize myscript.py` | End to end optimization for all the functions called in a workflow, by tracing to collect real inputs to ensure correctness and e2e performance optimization |
34+
| [Optimize all code in a repo](optimizing-with-codeflash/codeflash-all) | `codeflash --all` | Codeflash discovers all functions in a repo and optimizes all of them! |
35+
| [Optimize every new pull request](optimizing-with-codeflash/optimize-prs) | `codeflash init-actions` | Codeflash runs as a GitHub action and GitHub app and suggests optimizations for all new code in a Pull Request. |
3636

3737

3838
## How to use these docs
3939

40-
On the left side of the screen you'll find the docs navigation bar.
40+
On the left side of the screen, you'll find the docs navigation bar.
4141
Start by installing Codeflash, then explore the different ways of using it to optimize your code.
4242

4343
## Questions or Feedback?
4444

45-
We love feedback! If you have any questions or feedback, use the Intercom button in the lower right, join our [Discord](https://www.codeflash.ai/discord), or drop us a note at [[email protected]](mailto:[email protected]) - we read every message!
45+
Your feedback will help us make codeflash better, faster. If you have any questions or feedback, use the Intercom button in the lower right, join our [Discord](https://www.codeflash.ai/discord), or drop us a note at [[email protected]](mailto:[email protected]) - we read every message!

docs/docs/optimizing-with-codeflash/trace-and-optimize.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,27 @@ To optimize a script, `python myscript.py`, replace `python` with `codeflash opt
1111
codeflash optimize myscript.py
1212
```
1313

14-
To optimize code within pytest tests that you normally run like `python -m pytest tests/`, use this command:
14+
To optimize code within pytest tests that you could normally run like `python -m pytest tests/`, use this command:
1515

1616
```bash
1717
codeflash optimize -m pytest tests/
1818
```
1919

20-
This powerful command creates high-quality optimizations, making it ideal when you need to optimize a workflow or script. The initial tracing process is slow, so try to limit your script's runtime to under 1 minute for best results. If your workflow is longer, consider breaking it into smaller sections and optimizing them separately with limited but representative data.
20+
This powerful command creates high-quality optimizations, making it ideal when you need to optimize a workflow or script. The initial tracing process can be slow, so try to limit your script's runtime to under 1 minute for best results. If your workflow is longer, consider tracing it into smaller sections by using the Codeflash tracer as a context manager (point 3 below).
2121

2222
## What is the codeflash optimize command?
2323

24-
`codeflash optimize` does everything that an expert engineer would do while optimizing a workflow. It profiles your code, traces the execution of your workflow and generates a set of test cases that are derived from how your code is actually run.
24+
`codeflash optimize` tries to do everything that an expert engineer would do while optimizing a workflow. It profiles your code, traces the execution of your workflow and generates a set of test cases that are derived from how your code is actually run.
2525
Codeflash Tracer works by recording the inputs of your functions as they are called in your codebase. These inputs are then used to generate test cases that are representative of the real-world usage of your functions.
2626
We call these generated test cases "Replay Tests" because they replay the inputs that were recorded during the tracing phase.
2727

2828
Then, Codeflash Optimizer can use these replay tests to verify correctness and calculate accurate performance gains for the optimized functions.
2929
Using Replay Tests, Codeflash can verify that the optimized functions produce the same output as the original function and also measure the performance gains of the optimized function on the real-world inputs.
30-
This way you can be *sure* that the optimized function causes no changes of behavior for the traced workflow and also, that it is faster than the original function.
30+
This way you can be *sure* that the optimized function causes no changes of behavior for the traced workflow and also, that it is faster than the original function. To get more confidence on the correctness of the code, we also generate several LLM generated test cases and discover any existing unit cases you may have.
3131

3232
## Using codeflash optimize
3333

34-
Codeflash Tracer can be used in three ways:
34+
Codeflash script optimizer can be used in three ways:
3535

3636
1. **As an integrated command**
3737

@@ -47,7 +47,7 @@ Codeflash Tracer can be used in three ways:
4747
codeflash optimize path/to/your/file.py --your_options
4848
```
4949

50-
The above command should suffice in most situations. You can add a argument like `codeflash optimize -o trace_file_path.trace` if you want to customize the trace file location. Otherwise, it defaults to `codeflash.trace` in the cwd.
50+
The above command should suffice in most situations. You can add a argument like `codeflash optimize -o trace_file_path.trace` if you want to customize the trace file location. Otherwise, it defaults to `codeflash.trace` in the current working directory.
5151

5252
2. **Trace and optimize as two separate steps**
5353

@@ -76,18 +76,18 @@ Codeflash Tracer can be used in three ways:
7676
from codeflash.tracer import Tracer
7777
7878
with Tracer(output="codeflash.trace"):
79-
# Your code here
79+
model.predict() # Your code here
8080
```
8181

82-
Sometimes, if using the tracer as a module fails, then the Context Manager can also be used to trace the code sections. This also is much faster than tracing the whole script.
82+
This is much faster than tracing the whole script. Sometimes, if tracing the whole script fails, then the Context Manager can also be used to trace the code sections.
8383

84-
After this finishes, you can optimize using the replay tests
84+
After this finishes, you can optimize using the generated replay tests.
8585

8686
```bash
8787
codeflash --replay-test /path/to/test_replay_test_0.py
8888
```
8989

90-
More Options to the Tracer:
90+
More Options for the Tracer:
9191

9292
- `disable`: If set to `True`, the tracer will not trace the code. Default is `False`.
9393
- `max_function_count`: The maximum number of times to trace a single function. More calls to a function will not be traced. Default is 100.

0 commit comments

Comments
 (0)