Port only the functions that are slow to Rust, then verify them

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

Developers with a slow app can port just the hot functions to Rust instead of rewriting whole codebases, with automatic verification catching ports that code review would miss.

Read this as

fast-anything is a free, open-source command-line tool. It watches your running app, finds the few functions eating most of the time, and helps an AI coding agent rewrite just those in Rust, a fast programming language. It then records real inputs and replays them against the rewritten version to prove it behaves identically before switching anything on. Developers using Python, Node, Go, Java, Ruby and several other languages can adopt it, and it can be undone at any time.

Teams with performance bottlenecks can avoid months-long rewrites: fast-anything profiles the app, ports only the slowest functions to Rust via an AI agent, and blocks enabling any port unless it matches the original on 500 recorded calls plus generated edge cases like NaN and empty inputs. It refuses swaps that are slower per call than the original, and reversal is a one-line environment variable. Available via npm and Cargo; requires a Rust toolchain.

fast-anything profiles running apps across 12 runtimes, ranks functions by time and portability, records up to 500 real calls, and generates a one-function Rust crate plus TASK.md for agents (claude, codex, or any stdin-prompt command via --agent; also a Claude Code plugin and MCP server). verify replays all calls, rejecting the demo's caught bug (byte-vs-character comparison, 148/500 mismatches), plus derived edge cases (NaN, ±inf, -0.0, 16× inputs), floats matched within 1e-9. It also rejects ports slower per call than the original due to boundary costs; enable/disable is a byte-exact marked-block swap, FAST_ANYTHING_DISABLE=1 falls back.

Questions this answers

The article above answers these:

  • how do I speed up a slow Python app with Rust without rewriting it?
  • how do I verify a Rust port matches my original code?
  • how do I use fast-anything with Claude or Codex?

Read the original

This summary exists to save you time, not to replace the source.

Key terms

fast-anything Rust Claude npm Cargo TASK.md

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

datasette-charts 0.5a0

Datasette Charts 0.5a0 adds calendar heatmaps, box plots and active-over-time charts, enabling richer data visualisation directly in the browser without extra libraries.