215× on Rust: I re-ran fast-anything's 116× benchmark

fast-anything claims a 116× speedup for porting one Python function to Rust. On my 4-core AMD VM I measured 215× end to end — and the function itself ran 677× faster. The catch: most of that multiplier is a property of how slow the Python baseline is on your machine, not of the port.

The claim

fast-anything (EL4CTEO/fast-anything, 4,907 stars, created November 21) is a tool with a deliberately modest pitch: don't rewrite your app in Rust, rewrite the 5% that's slow. It profiles your app, has your coding agent port only the hot function to Rust, replays recorded calls against the port to prove it returns the same results, and swaps it in. Its README table leads with the Python fuzzy-dedupe example: 4.91s → 42ms, 116×, on a 12-thread i5-10500. An independent reproduction on a 16-thread i7-11700 got 5.23s → 16ms, 337×. The README is honest about one thing: the ports are multithreaded, "so whole-app speedups scale with the machine's thread count."

I ran the tool's own CI reproduction — the exact steps from its GitHub Actions workflow, with the repo's reference port standing in for the coding agent — on my machine: an AMD EPYC 9D25 with 4 logical CPUs, Python 3.12.3, Rust 1.100.1, fast-anything v0.9.1 built from source (cargo build --release took 1m 29s).

What the profiler found

The example app finds near-duplicate customer names: 700 generated names, pairwise Levenshtein distance, pairs within 2 edits. One function, fuzzy.find_duplicates, is 100.0% of the runtime. Inside it, levenshtein is called 244,650 times and accounts for 53.7% of self time; normalize runs 700 times.

One number worth recording before the headline: the profiled run took 26.85s against 9.22s without the profiler. Profiling made the app run 2.9× as long. The tool's own report says this plainly — shares are of the profiled run, and the profiler slows some code more than the rest, so a share isn't the part of the original's time a port can save. Good. Most tools don't say that.

The unprofiled baseline, three runs: 9.34s, 9.22s, 9.38s. All three printed the same result: 700 names, 822 likely duplicate pairs.

The verify step is the whole product

fast-anything verify built the reference Rust port and replayed calls against it:

✓ 33/33 calls give the same result (1 recorded + 7 edge cases + 25 derived) ✓ fuzzy.find_duplicates per call: 9181.3ms in Python, 13.6ms in Rust: 677× faster 

33 recorded and derived calls, all matching, including edge cases (NaN, ±infinity, -0.0, empty, non-ASCII). That is the part of the tool I would actually trust: the port doesn't ship until the replay matches. The 677× is the function-level number — one call, no interpreter startup, no name generation.

The bench

With the port enabled, three runs of the whole app: 0.053s, 0.044s, 0.083s. Same output, 822 pairs. The tool's own bench (3 rounds, original twice and Rust once per round, rotated order) reported:

Python ████████████████████████ 9.22s Rust ▏ 43ms ✓ python3 app.py is 215× faster end to end (median of 3 rounds, 213–224×; CPU time 117×; A/A ±2.0%) 

So on this box: 215×, not 116×. The number moved in my favor because my Python baseline is slower (9.22s vs their 4.91s) while the Rust time is nearly identical (43ms vs their 42ms). That is the first honest reading of the headline: the Rust port runs in ~42ms on a 12-thread i5 and ~43ms on a 4-core EPYC. The multiplier is mostly a measure of the denominator.

The second honest reading is in the tool's own report: CPU time improved 117× (9.22s → 79ms of user+system time), while wall-clock improved 215×. The gap between the two is parallelism — the port spreads rows across 4 threads. About half the wall-clock win is threads, not per-core speed. The report also gives an A/A control: the original against itself in the same rounds varied +1.3% (middle half -0.6% to +2.0%), so the 215× is far beyond noise. That control is the difference between a benchmark and a press release.

The third honest reading is the one the README doesn't headline: the reference port is not the same algorithm in a faster language. The Python levenshtein computes the full matrix for every pair. The Rust version trims the common prefix and suffix first, bails out early once the distance can't come in under the limit, skips pairs whose length difference already exceeds it, and runs rows in parallel. Part of the 677× is a smarter algorithm. That doesn't make the number fake — the tool's job is to make the app faster, and it did — but "Rust is 677× faster than Python" is the wrong sentence. "A ported, parallelized, early-exiting rewrite is 677× faster than a naive nested-loop Python version" is the right one.

Afterwards I ran fast-anything disable, and git diff confirmed fuzzy.py was untouched. The original code stays in place; FAST_ANYTHING_DISABLE=1 runs it any time. Reversible, one function at a time — that part of the pitch checks out too.

What I make of it

The 116× is real, and on a slower box it's 215×, because the headline number is a ratio and the ratio depends on your machine. What I actually verified: the scan finds the right function, the verify step replays real calls and refuses to ship a wrong port, the bench has an A/A noise control, and the port is reversible without touching your source. The part to keep in mind is that the speedup you get is the port's absolute time (~43ms here) against your baseline's absolute time — and that a chunk of the win is algorithmic, not linguistic. If your hot function is already a tight loop over numpy, this tool has much less to offer; if it's a naive nested loop like this one, the 5% rewrite is the cheapest 100× you'll ever buy.

Caveats, stated plainly

I used the repo's reference port, not a port written by a coding agent — the agent step is the one part of the loop I didn't exercise, so I can't vouch for what a real agent run produces on this example. One workload, one machine, 700 names, single seed. The 215× is a median of 3 rounds; the per-round range was 213–224×. The 42ms figure for the i5 and the 16ms figure for the i7 are the README's, not mine — I only measured the 43ms on my own box.

Sources

  • EL4CTEO/fast-anything (v0.9.1, commit c3e3dc5): https://github.com/EL4CTEO/fast-anything
  • The example and reference port: examples/fuzzy-dedupe/ in the same repo
  • The reproduction steps: .github/workflows/ci.yml in the same repo ("end to end on the demo (reference port instead of an agent)")
  • Machine: AMD EPYC 9D25, 4 logical CPUs, Linux x86_64; Python 3.12.3; rustc 1.100.1