codeflash/docs/index.mdx
Kevin Turcios da160020db docs
2025-07-30 19:50:51 -07:00

68 lines
3.3 KiB
Text

---
title: "What is Codeflash?"
description: "AI-powered Python performance optimizer that automatically speeds up your code while verifying correctness"
icon: "rocket"
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*.
### Features
<CardGroup cols={1}>
<Card title="Optimize a Single Function" icon="bullseye" href="/optimizing-with-codeflash/one-function">
Target and optimize individual Python functions for maximum performance gains.
```bash
codeflash --file path.py --function my_function
```
</Card>
<Card title="Trace & Optimize Workflows" 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">
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.
```bash
codeflash init-actions
```
</Card>
</CardGroup>
## How to use these docs
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.
## 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!