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
Codeflash is a powerful tool; here are our recommendations, tips and tricks on getting the best out of it. We do these ourselves, so we hope you will too!
11
+
Codeflash is a powerful tool; here are our recommendations based on how the Codeflash team uses Codeflash.
12
12
13
13
### Install the Github App and actions workflow
14
14
15
15
After you install Codeflash on an actively developed project, [installing the GitHub App](getting-started/codeflash-github-actions) and setting up the
16
16
GitHub Actions workflow will automatically optimize your code whenever new pull requests are opened. This ensures you get the best version of any changes you make to your code without any extra effort. We find that PRs are also the best time to review these changes, because the code is fresh in your mind.
17
17
18
+
### Find and optimize entire scripts with the Codeflash Tracer
19
+
20
+
Find the best results by running [Codeflash Optimize](optimizing-with-codeflash/trace-and-optimize) on your script to optimize it.
21
+
This internally runs a profiler, captures inputs to all the functions your script calls, and uses those inputs to create Replay tests and benchmarks.
22
+
The optimizations you get with this method, show you how much faster your workflow will get plus guarantee that your workflow won't break if you merge in the optimizations.
23
+
24
+
###
25
+
18
26
### Find optimizations on your whole codebase with `codeflash --all`
19
27
20
28
If you have a lot of existing code, run [`codeflash --all`](optimizing-with-codeflash/codeflash-all) to discover and fix any
21
29
slow code in your project. Codeflash will open new pull requests for any optimizations it finds, and you can review and merge them at your own pace.
22
30
23
-
### Find and optimize bottlenecks with the Codeflash Tracer
24
-
25
-
Find the best results by running [Codeflash Tracer](optimizing-with-codeflash/trace-and-optimize) on the entry point of your script before optimizing it. The Codeflash Tracer will generate a trace file and a Replay Test file that will help Codeflash understand the behavior & inputs of your functions and generate the highest quality optimizations.
Welcome! Codeflash is an AI performance optimizer for Python code.
10
9
Codeflash speeds up Python code by figuring out the best way to rewrite your code while verifying that the behavior of the code is unchanged.
11
10
12
-
The optimizations Codeflash finds are generally better algorithms, opportunities to remove wasteful compute, better logic, and utilization of more efficient library methods. Codeflash
13
-
does not modify the architecture of your code, but it tries to find the most efficient implementation of that architecture.
14
-
15
-
### How does Codeflash verify correctness?
16
-
17
-
Codeflash verifies the correctness of the optimizations it finds by generating and running new regression tests, as well as any existing tests you may already have. Codeflash tries to ensure that your
18
-
code behaves the same way before and after the optimization.
19
-
This offers high confidence that the behavior of your code remains unchanged.
20
-
21
-
### Continuous Optimization
22
-
23
-
Because Codeflash is an automated process, you can install it as a GitHub action and have it optimize the new code on every pull request.
24
-
When Codeflash finds an optimization, it will ask you to review it. It will write a detailed explanation of the changes it made, and include all relevant info like % speed increase and proofs of correctness.
25
-
26
-
This is a great way to ensure that your code, your team's code and your AI Agent's code are optimized for performance before it causes a performance regression. We call this *Continuous Optimization*.
11
+
The optimizations Codeflash finds are generally better algorithms, opportunities to remove wasteful compute, better logic, utilizing caching and utilization of more efficient library methods. Codeflash
12
+
does not modify the system architecture of your code, but it tries to find the most efficient implementation of that architecture.
27
13
28
14
### Features
29
15
@@ -35,34 +21,41 @@ This is a great way to ensure that your code, your team's code and your AI Agent
Automatically optimize code changes in pull requests with GitHub Actions integration.
39
+
Automatically find optimization code changes in Pull Requests with GitHub Actions integration.
54
40
```bash
55
41
codeflash init-actions
56
42
```
57
43
</Card>
58
44
</CardGroup>
59
45
46
+
### How does Codeflash verify correctness?
47
+
48
+
Codeflash verifies the correctness of the optimizations it finds by generating and running new regression tests, as well as any existing tests you may already have. Codeflash tries to ensure that your
49
+
code behaves the same way before and after the optimization.
50
+
This offers high confidence that the behavior of your code remains unchanged.
51
+
52
+
### Continuous Optimization
60
53
61
-
## How to use these docs
54
+
Because Codeflash is an automated process, the main way to use it is by installing it as a GitHub action and have it optimize the new code on every pull request.
55
+
When Codeflash finds an optimization, it will ask you to review it. It will write a detailed explanation of the changes it made, and include all relevant info like % speed increase and proofs of correctness.
62
56
63
-
On the left side of the screen, you'll find the docs navigation bar.
64
-
Start by installing Codeflash, then explore the different ways of using it to optimize your code.
57
+
This is a great way to ensure that your code, your team's code and your AI Agent's code are optimized for performance before it causes a performance regression. We call this *Continuous Optimization*.
65
58
66
59
## Questions or Feedback?
67
60
68
-
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:founders@codeflash.ai) - we read every message!
61
+
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:contact@codeflash.ai) - we read every message!
0 commit comments