Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Manual Configuration"
description: "Configure Codeflash for your project with pyproject.toml settings and advanced options"
icon: "gear"
sidebarTitle: "Configuration"
sidebarTitle: "Manual Configuration"
keywords: ["configuration", "pyproject.toml", "setup", "settings", "pytest", "formatter"]
---

Expand Down
7 changes: 6 additions & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"dark": "#1D4ED8"
},
"favicon": "/favicon.ico",
"integrations": {
"intercom": {
"appId": "ljxo1nzr"
}
},
"navigation": {
"tabs": [
{
Expand All @@ -26,7 +31,7 @@
]
},
{
"group": "🔧 CI/CD Integration",
"group": "🔧 Continuous Optimization",
"pages": [
"getting-started/codeflash-github-actions",
"optimizing-with-codeflash/optimize-prs",
Expand Down
13 changes: 9 additions & 4 deletions docs/getting-the-best-out-of-codeflash.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ keywords: ["best practices", "tips", "github actions", "tracer", "optimization",

# Getting the best out of Codeflash

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!
Codeflash is a powerful tool; here are our recommendations based on how the Codeflash team uses Codeflash.

### Install the Github App and actions workflow

After you install Codeflash on an actively developed project, [installing the GitHub App](getting-started/codeflash-github-actions) and setting up the
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.

### Find and optimize entire scripts with the Codeflash Tracer

Find the best results by running [Codeflash Optimize](optimizing-with-codeflash/trace-and-optimize) on your script to optimize it.
This internally runs a profiler, captures inputs to all the functions your script calls, and uses those inputs to create Replay tests and benchmarks.
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.

###

### Find optimizations on your whole codebase with `codeflash --all`

If you have a lot of existing code, run [`codeflash --all`](optimizing-with-codeflash/codeflash-all) to discover and fix any
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.

### Find and optimize bottlenecks with the Codeflash Tracer

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.

### Review the PRs Codeflash opens

Expand Down
39 changes: 16 additions & 23 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,10 @@ sidebarTitle: "Overview"
keywords: ["python", "performance", "optimization", "AI", "code analysis", "benchmarking"]
---

Welcome! Codeflash is an AI performance optimizer for Python code.
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.

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

### How does Codeflash verify correctness?

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

### Continuous Optimization

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.
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.

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*.
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
does not modify the system architecture of your code, but it tries to find the most efficient implementation of that architecture.

### Features

Expand All @@ -35,34 +21,41 @@ This is a great way to ensure that your code, your team's code and your AI Agent
```
</Card>

<Card title="Trace & Optimize Workflows" icon="route" href="/optimizing-with-codeflash/trace-and-optimize">
<Card title="Optimize Workflows with Tracing" icon="route" href="/optimizing-with-codeflash/trace-and-optimize">
End-to-end optimization of entire Python workflows with execution tracing.
```bash
codeflash optimize myscript.py
```
</Card>

<Card title="Optimize Your Entire Codebase" icon="database" href="/optimizing-with-codeflash/codeflash-all">
<Card title="Optimize Your Entire Codebase" icon="globe" href="/optimizing-with-codeflash/codeflash-all">
Automatically optimize all functions in your project with comprehensive analysis.
```bash
codeflash --all
```
</Card>

<Card title="Optimize Pull Requests" icon="git-pull-request" href="/optimizing-with-codeflash/optimize-prs">
Automatically optimize code changes in pull requests with GitHub Actions integration.
Automatically find optimization code changes in Pull Requests with GitHub Actions integration.
```bash
codeflash init-actions
```
</Card>
</CardGroup>

### How does Codeflash verify correctness?

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

### Continuous Optimization

## How to use these docs
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.
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.

On the left side of the screen, you'll find the docs navigation bar.
Start by installing Codeflash, then explore the different ways of using it to optimize your code.
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*.

## Questions or Feedback?

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 [contact@codeflash.ai](mailto:founders@codeflash.ai) - we read every message!
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 [contact@codeflash.ai](mailto:contact@codeflash.ai) - we read every message!
4 changes: 2 additions & 2 deletions docs/optimizing-with-codeflash/trace-and-optimize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ This powerful command creates high-quality optimizations, making it ideal when y

The generated replay tests and the trace file are for the immediate optimization use, don't add them to git.

## Codeflash optimize demo (1 min)
## Codeflash optimize 1 min demo

<iframe width="750" height="460" src="https://www.youtube.com/embed/_nwliGzRIug" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<iframe width="640" height="400" src="https://www.youtube.com/embed/_nwliGzRIug" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>


## What is the codeflash optimize command?
Expand Down
Loading