Skip to main content
Back

fast-anything Rewrites Python CPU Hotspots in Rust for 116x Speedup

A new open-source tool profiles your app, ports only the hot functions to Rust with an AI coding agent, and verifies behavior stays identical.

Pro

Repo, Full Access
  • fast-anything profiles apps and ports only hot functions to Rust via a coding agent
  • Reported wins: Python 116x, PHP 55x, Go 21x, TypeScript 20x, Ruby 14x on fuzzy dedupe benchmarks
  • Replays up to 500 recorded real calls plus shrunk edge cases to verify identical behavior
  • Supports Python, Node, Ruby, Java, Go, PHP, C, C++ via PyO3, napi-rs, and a JSON C bridge
  • Ships Claude Code plugin and built-in MCP server exposing eight tools for agents
  • MIT licensed, installable via npm i -g @el4cteo/fast-anything or cargo install fast-anything

fast-anything is an open-source tool that profiles an application, identifies CPU-heavy functions, asks a coding agent to port selected functions to Rust, and replays observed calls against the compiled replacement. It currently supports Python, Node.js, Ruby, Java, Go, PHP, C, and C++.

Whole-application rewrites carry broad migration and maintenance costs. fast-anything narrows that work to deterministic functions that consume most of the runtime, leaving the surrounding application in its original language. The generated port can be enabled through a marked source block, disabled cleanly, or bypassed at runtime with an environment variable.

The fast-anything CLI profiling and porting a function to Rust
The CLI profiles an application, prepares a Rust port, verifies recorded calls, and benchmarks the result.

Profile first, port second

After installation through npm or Cargo, the CLI accepts an application entry point and an optional agent. It works with Claude, Codex, or any command that reads a prompt from standard input. Developers can also give the generated TASK.md file to another coding tool or implement the port manually.

  1. scan profiles the application and ranks functions by runtime cost and portability. Portability reflects whether a function and its data can cross the language bridge without hidden state or unsupported objects.
  2. port records up to 500 observed calls, creates a one-function Rust crate, and writes the agent brief.
  3. verify builds the crate in release mode and compares its output with the original function for every test case.
  4. enable and disable insert or remove a marked integration block. The disable operation removes that block byte for byte.
  5. bench runs the original and Rust-backed applications in an interleaved sequence to reduce timing bias.
  6. report generates Markdown and an SVG summary suitable for a pull request.