fast-anything — Profile Python, Node or Ruby apps and port only the slow functions to Rust
fast-anything profiles an app, ranks functions by time and portability, has a coding agent port only the hot ones to Rust, then verifies the port against recorded calls before swapping it in.
| Stars | 3,951 |
|---|---|
| License | MIT |
| Repo Language | Rust |
| Install | npm i -g @el4cteo/fast-anything or cargo install fast-anything |
| Supported Runtimes | Python, Node, TypeScript, Ruby, Java, Kotlin, Go, PHP, C, C++, C#, R |
| Agent Support | claude, codex, or any command reading a prompt on stdin |
| Recorded Calls | Up to 500 per port |
// What Is It
fast-anything is an MIT-licensed CLI from EL4CTEO that profiles Python, Node, TypeScript, Ruby, Java, Kotlin, Go, PHP, C, C++, C#, and R applications to find the small set of functions consuming most runtime. Instead of rewriting an entire app in Rust, it has a coding agent port only those hot functions, then verifies the port against real recorded calls before swapping it in. It is distributed via npm and crates.io and also ships as a Claude Code plugin and MCP server.
// How It Works
The tool runs in stages: `scan` profiles the app and ranks functions by time multiplied by how portable they are; `port` records up to 500 real calls and generates a one-function Rust crate plus a TASK.md prompt for the agent; `verify` release-builds the port and replays every recorded call to confirm matching behavior. `enable` and `disable` swap the Rust implementation in or out as a single marked block that is removed byte for byte, making the change reversible. `bench` times the whole app in rotated rounds of original, original again as an A/A noise control, and Rust, reporting wall and CPU time.
// Why It Matters
Full rewrites in Rust cost months of work, long compile times, and large target directories, while most runtime typically sits in a few functions. fast-anything targets that narrow slice and adds a verification step that catches ports which look correct but differ in behavior, such as comparing bytes instead of characters. The trade-off is that it depends on a Rust toolchain and a coding agent, and only functions that are portable and well-covered by recorded calls are candidates for porting.