From 224d59d2dd772679fa04f09e071ea0665861f939 Mon Sep 17 00:00:00 2001 From: Saurabh Misra Date: Fri, 1 Aug 2025 09:27:17 -0700 Subject: [PATCH 1/2] update version 1 Signed-off-by: Saurabh Misra --- docs/configuration.mdx | 2 +- docs/docs.json | 7 +++- docs/getting-the-best-out-of-codeflash.mdx | 13 +++++--- docs/index.mdx | 39 +++++++++------------- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/docs/configuration.mdx b/docs/configuration.mdx index 38f24b51f..07f36821b 100644 --- a/docs/configuration.mdx +++ b/docs/configuration.mdx @@ -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"] --- diff --git a/docs/docs.json b/docs/docs.json index d747ccac4..bd052addf 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -8,6 +8,11 @@ "dark": "#1D4ED8" }, "favicon": "/favicon.ico", + "integrations": { + "intercom": { + "appId": "ljxo1nzr" + } + }, "navigation": { "tabs": [ { @@ -26,7 +31,7 @@ ] }, { - "group": "🔧 CI/CD Integration", + "group": "🔧 Continuous Optimization", "pages": [ "getting-started/codeflash-github-actions", "optimizing-with-codeflash/optimize-prs", diff --git a/docs/getting-the-best-out-of-codeflash.mdx b/docs/getting-the-best-out-of-codeflash.mdx index 7db56e711..4a98badc2 100644 --- a/docs/getting-the-best-out-of-codeflash.mdx +++ b/docs/getting-the-best-out-of-codeflash.mdx @@ -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 diff --git a/docs/index.mdx b/docs/index.mdx index f3cb3af02..432521a93 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -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 @@ -35,14 +21,14 @@ This is a great way to ensure that your code, your team's code and your AI Agent ``` - + End-to-end optimization of entire Python workflows with execution tracing. ```bash codeflash optimize myscript.py ``` - + Automatically optimize all functions in your project with comprehensive analysis. ```bash codeflash --all @@ -50,19 +36,26 @@ 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. + Automatically find optimization code changes in Pull Requests with GitHub Actions integration. ```bash codeflash init-actions ``` +### 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! From 782e285ff9023caf0fe37dcf98f257b9ee00bb2c Mon Sep 17 00:00:00 2001 From: Saurabh Misra Date: Fri, 1 Aug 2025 15:05:59 -0700 Subject: [PATCH 2/2] simple fixes Signed-off-by: Saurabh Misra --- docs/optimizing-with-codeflash/trace-and-optimize.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/optimizing-with-codeflash/trace-and-optimize.mdx b/docs/optimizing-with-codeflash/trace-and-optimize.mdx index 07cda05f5..9452b0b59 100644 --- a/docs/optimizing-with-codeflash/trace-and-optimize.mdx +++ b/docs/optimizing-with-codeflash/trace-and-optimize.mdx @@ -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 - + ## What is the codeflash optimize command?