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
Binary file added docs/images/priority-order.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions docs/optimizing-with-codeflash/trace-and-optimize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ sidebarTitle: "Optimize E2E Workflows"
keywords: ["tracing", "workflow optimization", "replay tests", "end-to-end", "script optimization", "context manager"]
---

Codeflash supports optimizing an entire Python script end-to-end by tracing the script's execution and generating Replay Tests.
Codeflash can optimize an entire Python script end-to-end by tracing the script's execution and generating Replay Tests.
Tracing follows the execution of a script, profiles it and captures inputs to all functions it called, allowing them to be replayed during optimization.
Codeflash uses these Replay Tests to optimize all functions called in the script, starting from the most important ones.
Codeflash uses these Replay Tests to optimize the most important functions called in the script, delivering the best performance for your workflow.

![Function Optimization](/images/priority-order.png)

To optimize a script, `python myscript.py`, simply replace `python` with `codeflash optimize` and run the following command:

Expand Down
Loading