Skip to content

Commit f99a1e5

Browse files
Merge pull request #193 from codeflash-ai/update-docs
Update docs
2 parents 88babdd + 4280246 commit f99a1e5

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

docs/docs/codeflash-concepts/how-codeflash-works.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ Codeflash currently only runs tests that directly call the target function in th
2121

2222
## Optimization Generation
2323

24-
To optimize code, Codeflash first gathers all necessary context from the codebase. It then calls our backend to generate several candidate optimizations. These are called "candidates" because their speed and correctness haven't been verified yet. Both properties will be verified in later steps.
25-
24+
To optimize code, Codeflash first gathers all necessary context from the codebase. It also line-profiles your code to understand where the bottlenecks might reside. It then calls our backend to generate several candidate optimizations. These are called "candidates" because their speed and correctness haven't been verified yet. Both properties will be verified in later steps.
2625
## Verification of correctness
2726

2827
![Verification](/img/codeflash_arch_diagram.gif)
2928

30-
The goal of correctness verification is to ensure that when the original code is replaced by the new code, there are no behavioral changes in the code and the rest of the system. This means the replacement should be completely safe.
29+
The goal of correctness verification is to ensure that when the new code replaces the original code, there are no behavioral changes in the code and the rest of the system. This means the replacement should be completely safe.
3130

3231
To verify correctness, Codeflash calls the function with numerous inputs, confirming that the new function behaves identically to the original.
3332

@@ -60,4 +59,4 @@ Codeflash implements several techniques to measure code performance accurately.
6059

6160
## Creating Pull Requests
6261

63-
Once an optimization passes all checks, Codeflash creates a pull request through the Codeflash GitHub app directly in your repository. The pull request includes the new code, the speedup percentage, an explanation of the optimization, test statistics including coverage, and the test content itself. You can review and merge the new code if it meets your standards. Feel free to modify the code as needed—we welcome your improvements!
62+
Once an optimization passes all checks, Codeflash creates a pull request through the Codeflash GitHub app directly in your repository. The pull request includes the new code, the speedup percentage, an explanation of the optimization, test statistics including coverage, and the test content itself. You can review, edit, and merge the new code.

docs/docs/intro.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@
22
sidebar_position: 1
33
slug: /
44
---
5-
# Introduction
6-
Welcome to the Codeflash documentation!
7-
85
## What is Codeflash?
96

107
Welcome! Codeflash is an AI performance optimizer for Python code.
11-
Codeflash speeds up Python code by figuring out the best way to rewrite a particular function, while verifying the behavior of the code is unchanged.
8+
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.
129

13-
The optimizations Codeflash finds are generally better algorithms, opportunities to remove wasteful compute, better logic, and utilization of more efficient library methods.
10+
The optimizations Codeflash finds are generally better algorithms, opportunities to remove wasteful compute, better logic, and utilization of more efficient library methods. Codeflash
11+
does not modify the architecture of your code, but it tries to find the most efficient implementation of that architecture.
1412

1513
### How does Codeflash verify correctness?
1614

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.
18-
This offers additional confidence that the behavior of your code remains unchanged.
15+
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
16+
code behaves the same way before and after the optimization.
17+
This offers high confidence that the behavior of your code remains unchanged.
1918

2019
### Continuous Optimization
2120

22-
Because Codeflash is an automated process, you can install it as a GitHub action and have it run on every pull request made to your codebase.
21+
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.
2322
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.
2423

25-
Having Codeflash installed on your Github repository gives you the peace of mind that your code is always written optimally. We call it *Continuous Optimization*.
24+
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*.
2625

2726
### Features
2827

@@ -34,9 +33,6 @@ Having Codeflash installed on your Github repository gives you the peace of mind
3433
| [Optimize all code in a repo](optimizing-with-codeflash/codeflash-all) | Codeflash discovers all functions in a repo and optimizes all of them! |
3534
| [Optimize every new pull request](optimizing-with-codeflash/optimize-prs) | Codeflash runs as a GitHub action and GitHub app and reviews all new code for Optimizations |
3635
| [Optimize a whole workflow by Tracing it](optimizing-with-codeflash/trace-and-optimize) | End to end optimization for all the functions called in a workflow, by tracing to collect real inputs seen during execution and ensuring correctness and performance optimization with those inputs |
37-
| Correctness Verification | The way Codeflash gains high confidence that the newly generated optimization has the same behavior as the originally written function. |
38-
| Performance Measurement | Measuring execution times on a set of inputs to estimate runtime performance. |
39-
4036

4137
## How to use these docs
4238

@@ -45,4 +41,4 @@ Start by installing Codeflash, then explore the different ways of using it to op
4541

4642
## Questions or Feedback?
4743

48-
We love feedback! If you have any questions or feedback, use the Intercom button in the lower right, or drop us a note at [founders@codeflash.ai](mailto:[email protected]) - we read every message!
44+
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 [contact@codeflash.ai](mailto:[email protected]) - we read every message!

docs/docs/optimizing-with-codeflash/benchmarking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 5
33
---
44
# Using Benchmarks
55

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
sidebar_position: 4
33
---
4-
# Optimize Workflows End-to-End
4+
# Optimize Workflows End-to-End by Tracing them.
55

6-
Codeflash supports optimizing an entire Python script end to end by tracing the execution of the script and generating Replay Tests. These Replay Tests can be used to optimize all the functions called in the script.
6+
Codeflash supports optimizing an entire Python script end to end by tracing the execution of the script and generating Replay Tests. Tracing means following the execution of a script and capturing the inputs to all the functions called, so they can be replayed again while optimizing. These Replay Tests can be used to optimize all the functions called in the script.
77

88
## Motivation for Tracing a workflow
99

0 commit comments

Comments
 (0)