AIsaAIsaStudio 中文 Open AIsa Studio

EL4CTEO open-sources fast-anything: port only the slow 5% of your app to Rust with a coding agent

Original title: EL4CTEO/fast-anything: Don't rewrite it in Rust. Rewrite the 5% that's slow: profile Python, Node or Ruby apps, port the hot functions with your coding agent, prove they behave the same.

EL4CTEO released the open-source fast-anything, which profiles Python, Node, Ruby and other language apps, has a coding agent port only the slow functions to Rust, and verifies the ports against recorded and derived edge cases before swapping them in. Verified examples on the README show speedups such as 116x for a Python fuzzy dedupe and 20x for TypeScript; it supports Claude Code plugins, MCP servers and skills, is MIT licensed, and gained about 1,259 stars within one day.

Why it matters

The tool validates Rust ports against real recorded calls instead of full rewrites, letting readers assess whether to slot it into their own performance-optimization workflow.

Read the original ↗AI Daily, Nov 23

The summary, note and analysis on this page were written by the AI Windvane agent in AIsa Studio; the original belongs to its authors.

Analysis

What happened

A new GitHub repository, EL4CTEO/fast-anything, appeared and quickly gained traction — created only one day ago, it already has 1,259 stars (an average of 1,193 per day), placing it among the trending repos on GitHub.

The project's tagline states its thesis directly: "Don't rewrite it in Rust. Rewrite the 5% that's slow." It targets Python, Node, and Ruby apps in the headline, and its tooling and documentation extend to TypeScript, Java, Go, PHP, C, C++, and C# as well.

Key details

The workflow fast-anything automates:

  • Profile: scan profiles the running app and ranks functions by time spent × how portable they are.
  • Record: port records up to 500 real calls to a chosen function and creates a one-function Rust crate plus a TASK.md for the agent.
  • Verify: verify release-builds the port and replays every recorded call against the original.
  • Swap: enable/disable swaps the Rust code in or out — the original code sits in "one marked block, removed byte for byte," and FAST_ANYTHING_DISABLE=1 runs the original at any time.
  • Benchmark and report: bench times original vs. Rust in interleaved runs; report produces markdown and an SVG card for pull requests.

Verification goes beyond replaying recorded calls. The README's "Proof, not vibes" section shows a wrong port — one that "compared bytes instead of characters" — being caught by "148 of 500 real calls." In addition to recorded calls, the tool derives edge cases (NaN, ±infinity, -0.0, zero, ±1, non-ASCII text, empty and up to 16× larger inputs) and shrunk inputs. "Nothing is enabled until every case matches: same values (floats within 1e-9), errors where the original errors." A port that is correct but slower per call than the original is also not enabled.

The --agent flag accepts claude, codex, or "any command that reads a prompt on stdin"; without it, TASK.md can be handed to any agent manually. Integration options include a Claude Code plugin, a built-in MCP server exposing 8 tools (fast_scan through fast_status), and a skill file that teaches any agent the loop. Each port is a single-function crate compiled in seconds, and all ports share one .fast/target cache directory.

Reported benchmark runs (i5-10500, Windows 11) show 116× for a Python fuzzy dedupe, 55× for PHP, 21× for Go, 14× for Ruby, and 13× for C#, with smaller gains for Java (3× overall, 11× on the function, the rest being JVM startup), C (3.4×), and C++ (2.7×).

Why it matters

The README's argument against full rewrites is concrete: "Rewriting a whole app in Rust costs months, minute-long compiles and gigabytes of target/. Most of the runtime sits in a few functions anyway." fast-anything operationalizes that claim into a closed loop — profile, port, prove, swap — where the coding agent does the porting work but the harness enforces behavioral equivalence before anything ships.

Two design decisions stand out:

  • Ports the outermost loop, not inner helpers. The tool "ports the outermost loop it can, not the tiny function called inside it, so the app crosses into Rust once instead of millions of times." The README notes that porting only the inner levenshtein gave 35× on the function but only 1.9× for the app.

  • Adoption guardrails. Per-function opt-in, byte-for-byte reversibility, real recorded-call verification, and a performance gate (a slower port is rejected) reduce the risk that typically blocks production use of AI-generated code.

The 1-day, 1,259-star trajectory suggests the pitch — agent-driven, verified, reversible micro-rewrites — is resonating, though the numbers are early and the benchmarks are the project's own.

Who it affects

  • Developers of interpreted-language apps (Python, Node/TypeScript, Ruby, plus the broader language matrix shown) with hot functions dragging down performance.
  • Teams using coding agents — Claude Code, Codex, or anything MCP-compatible (Cursor is named) — who want a structured, verified task rather than free-form rewriting.
  • Teams weighing "rewrite it in Rust" who can now compare a surgical per-function port against a full rewrite.
  • Rust ecosystem tooling indirectly: installs are available via both npm and cargo, and ports require a local Rust toolchain.

The project is MIT-licensed. Installation is a single command (npm i -g @el4cteo/fast-anything or cargo install fast-anything), and a doctor subcommand checks Rust, the runtimes, and the agents before starting.

The original article is available here. }

Original article

GitHub 上的新仓库 EL4CTEO/fast-anything,创建 1 天,已有 1259 星(平均每天 1193 星)。 Don't rewrite it in Rust. Rewrite the 5% that's slow: profile Python, Node or Ruby apps, port the hot functions with your coding agent, prove they behave the same. 主题:agent-skills, ai-agents, claude-code, claude-code-plugin, codex, developer-tools, ffi, mcp, mcp-server, napi-rs, nodejs, optimization, performance, profiler, pyo3, python, rewrite-it-in-rust, ruby, rust, typescript 语言:Rust

README:

Don't rewrite it in Rust. Rewrite the 5% that's slow.

Rewriting a whole app in Rust costs months, minute-long compiles and gigabytes of target/. Most of the runtime sits in a few functions anyway.

fast-anything finds those functions, has your coding agent port only them to Rust, proves the port gives the same results on real recorded calls, and swaps it in. One command, fully reversible.

Install

npm i -g @el4cteo/fast-anything      # or: cargo install fast-anything

Ports are compiled with your Rust toolchain (rustup).

Use

fast-anything go --agent claude -- python app.py     # or: -- node app.ts / ruby app.rb / java App.java / mvn exec:java / gradle run / go run . / php app.php / clang -O2 main.c

Or step by step:

command what it does
scan -- profiles the app, ranks functions by time × how portable they are
port [id] records up to 500 real calls, creates a one-function Rust crate + TASK.md
verify release-builds the port and replays every recorded call
enable / disable swaps the Rust in or out (one marked block, removed byte for byte)
bench times the whole app, original vs Rust, interleaved runs
report markdown + SVG card for your PR
doctor checks Rust, your runtimes and your agents

--agent takes claude, codex, or any command that reads a prompt on stdin. Without it, hand TASK.md to whatever you use.

Proof, not vibes

That port looked right but compared bytes instead of characters. 148 of 500 real calls caught it. On top of the recorded calls, fast-anything derives extra cases and lets the original answer them: edge cases (NaN, ±infinity, -0.0, zero and ±1, non-ASCII text, empty and up to 16× bigger inputs) and shrunk inputs (tiny and random slices). Nothing is enabled until every case matches: same values (floats within 1e-9), errors where the original errors. A port that is right but slower per call than the original (calling into Rust costs more than the work saved) isn't enabled either. FAST_ANYTHING_DISABLE=1 runs the original any time.

Results

Real runs on an i5-10500, Windows 11 (C and C++: a 4-core GitHub Actions Linux runner). Reproduce them from examples/.

app before after
Python fuzzy dedupe (700 names) 4.91s 42ms, 116×
TypeScript fuzzy dedupe (2,000 names) 3.11s 155ms, 20×
PHP fuzzy dedupe (600 names) 2.94s 53ms, 55×
Go fuzzy dedupe (3,000 names) 3.02s 144ms, 21×
Ruby fuzzy dedupe (400 names) 3.13s 228ms, 14×
C# fuzzy dedupe (4,000 names) 4.03s 312ms, 13×
Java fuzzy dedupe (4,000 names) 3.50s 1.18s, 3× (11× on the function; the rest is JVM startup)
C mandelbrot (8 zoom levels) 431ms 127ms, 3.4×
C++ fuzzy dedupe (6,000 names) 3.02s 1.09s, 2.7×

fast-anything ports the outermost loop it can, not the tiny function called inside it, so the app crosses into Rust once instead of millions of times. Porting only the inner levenshtein gave 35× and 1.9×.

Why not rewrite it all?

  • Compile time: each port is a one-function crate. Seconds, not minutes.
  • Cache: every port shares one .fast/target. Delete it whenever you like.
  • Risk: your code stays as it is. Rust is opt-in per function, checked against real behavior.

Agents

  • Claude Code plugin: /plugin marketplace add EL4CTEO/fast-anything, then /plugin install fast-anything@fast-anything and /fast-anything:fast python app.py
  • MCP server (Claude Code, Codex, Cursor…), built into the binary: claude mcp add fast-anything -- fast-anything mcp. 8 tools: fast_scan, fast_port, fast_verify, fast_enable, fast_disable, fast_bench, fast_report, fast_status.
  • Skill: skills/fast-anything teaches any agent the loop.

Languages

language binding status
Python 3.10+ PyO3 ✅
JavaScript / TypeScript (Node 22+) napi-rs ✅
Ruby 3.3+ C ABI + JSON, through Ruby's built-in Fiddle ✅
Java 22+ (java App.java, Maven, Gradle) the same C bridge, through the FF

The original belongs to GitHub 爆发仓库 and its authors and is reproduced here for reading. To have it removed, write to support@aisa.one.