fast-anything skill: Port only the Python code that matters

Share

As of 25 November 2026, fast-anything is a Python performance skill that profiles a real run, records up to 500 calls to an eligible hot function, and enables a Rust replacement only after its outputs match. Use it when a small, deterministic function dominates runtime, not when an application merely feels slow.

At a glance

  • fast-anything’s skill says to skip a function below 2% of total runtime, because the visible gain is unlikely.
  • The porting step records up to 500 real calls before Rust code is written.
  • Its verification rule accepts float results only within 1e-9 and requires matching error behaviour.
  • The published Python fuzzy-deduplication example fell from 4.91 seconds to 42 milliseconds, a maintainer-reported result on 700 names.

Is fast-anything a general AI coding skill?

fast-anything is a narrow performance skill, not a broad software-development method. Its job is to identify one expensive function, create a small Rust crate for it, replay observed behaviour, and switch that replacement on only when it is both correct and worth the call overhead.

That makes it different from planning-orchestration packages. The published Superpowers workflow, for example, covers design, task planning, test-driven development and review. fast-anything instead starts after you have a working program and a realistic workload that exposes a slow path.

The important word is selective. A hot path is code executed often enough, or expensively enough, to consume an outsized share of a program’s runtime. The skill instructs the agent to profile the command users actually run, rather than a test suite that might exercise very different data.

What does fast-anything actually change?

fast-anything leaves the original Python function in place and adds a marked swap block after verification. The skill instructions say not to edit the original function, which matters because rollback should restore the prior Python path without a manual rewrite.

The tool is aimed at deterministic functions: functions that return the same answer for the same plain inputs. In Python, the project lists module-level functions, static methods, and class methods that do not use cls as eligible forms. Numbers, strings, lists, dictionaries, dataclasses, named tuples and numeric NumPy arrays count as plain data under its documented rules.

It is deliberately cautious about code that interacts with the outside world. I/O, randomness, mutable globals and unguarded entry-script code can make a function unsuitable, because a recorded call cannot safely stand in for changing system state. The current changelog says the scanner also detects I/O and nondeterminism reached through import aliases.

The practical distinction: port an expensive transformation such as fuzzy matching, parsing, ranking or image-independent numeric work. Do not start with database calls, HTTP handlers, logging-heavy functions or code whose result depends on time, environment variables or random state.

Which Python hot path should you port?

That threshold comes from the project’s own skill instructions; it is a triage rule, not a law of performance engineering.

Prefer an outer loop over a tiny helper. The maintainer’s published explanation says fast-anything tries to move the outermost loop it can, so Python crosses into Rust once instead of once per inner operation. In the supplied fuzzy-matching comparison, porting the inner Levenshtein helper reportedly produced a much smaller end-to-end gain than moving the broader loop.

Concrete choiceExact figure to useWhat it means in practiceEvidence tier
Ignore a small candidateUnder 2% of runtimeDo not port it first. Even deleting its cost cannot create a large whole-app gain.Primary source: documented skill rule
Port one pure Python transformationUp to 500 recorded callsGood default when real inputs are varied enough to expose Unicode, empty-data and error cases.Primary source: vendor documentation
Profile a long-running service30-second scan durationUse a bounded production-like run instead of waiting for an indefinitely running server.Primary source: vendor documentation
Enable a numerically sensitive port1e-9 float toleranceCheck that this tolerance fits your domain before treating a passed verification as sufficient.Primary source: vendor documentation
Roll back after deployment1 environment flagFAST_ANYTHING_DISABLE=1 runs the original implementation for that execution.Primary source: vendor documentation

The decision table adds the part many skill listings omit: profiling is only the first gate. A function must also be portable, testable with recorded calls, and large enough that the Python-to-Rust boundary does not consume the gain.

How do you profile a Python app safely?

Run the program using a workload that resembles the slow behaviour users see. That could be a batch import, a ranking job, a report generation command, or a fixture that represents a troublesome customer account. Do not substitute a unit-test command simply because it is easy to automate.

fast-anything scan -- python app.py

The project’s published loop tells the agent to choose the top function marked “port it.” Read the rejection reasons too. A “not portable” result can reveal a useful refactor: move pure calculation out of a request handler, then leave file and network work in Python.

For a server or graphical app, fast-anything documents scan --duration 30. That gives the profiler a fixed 30-second window, then stops the process similarly to Ctrl+C for Python. It is useful only if traffic or scripted activity reaches the expensive route during that window.

How should you port the selected function?

After selecting an identifier, run fast-anything port <id>. The command re-runs the application, captures up to 500 observed calls, and creates a dedicated Rust port directory with a stub plus a TASK.md file describing the work.

Rust is a systems language that gives more direct control over memory and loops. That can reduce overhead in string comparison or repeated collection work. It does not automatically make an algorithm better, so preserve the algorithm first and remove needless allocations only after the output matches.

  • Read TASK.md before changing generated Rust code.
  • Preserve Unicode behaviour, integer ranges, float operation order and exceptions.
  • Keep the documented function and module names, so the generated bridge can find the replacement.
  • Run cargo check before verification, which catches Rust compile errors quickly.

fast-anything requires a Rust toolchain for ports. The project points users to rustup, Rust’s official installer, while its doctor command checks readiness for the runtimes and agents involved. Scanning can identify candidates before Rust is installed; building and enabling cannot.

How does fast-anything prove correctness?

Verification is the feature that makes this more than “ask an agent to rewrite Python in Rust.” fast-anything verify <id> builds the port in release mode and replays every recorded call. A mismatch should be fixed in Rust, never hidden by changing recordings.

The project says it supplements recorded inputs with derived cases. Those include NaN, positive and negative infinity, negative zero, empty values, non-ASCII text and larger inputs. It also produces shrunk inputs, meaning smaller slices that help isolate a failure.

A published example caught a string-semantics bug in 148 of 500 recorded calls because the Rust port compared bytes where the original compared characters. That is precisely the kind of defect a normal happy-path benchmark can miss, especially when Python strings include accented characters, emoji or combining marks.

The current changelog adds further safeguards: Python verification distinguishes integers from floats, and a Rust panic does not count as matching an exception. The tool also refuses to enable code changed after a successful verification, according to the same release history.

Will the Rust port speed up the whole app?

Not necessarily. A faster function can make little difference if startup, database time, API latency or another unported section dominates the program. That is why whole-app benchmarking matters more than a microbenchmark of the rewritten loop.

The project reports several reproducible examples, but they are maintainer measurements on specified sample workloads, not a promise for your code. Its Python fuzzy-deduplication example moved from 4.91 seconds to 42 milliseconds. Its TypeScript example moved from 3.11 seconds to 155 milliseconds.

Published example workloadBeforeAfterReported whole-app gainEvidence tier
Python fuzzy dedupe, 700 names4.91s42ms116×Maintainer benchmark claim
TypeScript fuzzy dedupe, 2,000 names3.11s155ms20×Maintainer benchmark claim
PHP fuzzy dedupe, 600 names2.94s53ms55×Maintainer benchmark claim
Ruby fuzzy dedupe, 400 names3.13s228ms14×Maintainer benchmark claim

The figures above are published by the project for an i5-10500 running Windows 11. Treat them as evidence that the approach can work, not as a purchasing forecast. Your own fast-anything bench result should decide whether to keep a port.

Published examples show hot-loop speedups vary by workload: Python fuzzy dedupe, TypeScript fuzzy dedupe, PHP fuzzy dedupe, Ruby fuzzy dedupe
Published examples show hot-loop speedups vary by workload · Source: raw.githubusercontent.com

How do Claude Code and Codex use the skill?

fast-anything offers three routes: a command-line workflow, an agent skill, and an MCP server. MCP, short for Model Context Protocol, exposes named tools to compatible coding agents rather than relying on one large pasted prompt.

For Claude Code, the project documents adding the fast-anything plugin marketplace, installing the plugin, then invoking /fast-anything:fast python app.py. For Codex, it documents adding the same repository as a marketplace and installing the plugin from /plugins.

The local MCP interface lists eight tools: scan, port, verify, enable, disable, benchmark, report and status. Its marketplace configuration labels fast-anything as a Coding plugin and marks installation as available. That confirms the packaging mechanism, but it does not independently establish the quality of any generated Rust code.

What should you actually do?

Install fast-anything if you can name a repeatable slow Python command and suspect a pure transformation is involved. Start with a scan of representative data. Do not begin by promising a rewrite, choosing Rust for every module, or interpreting a profiler result as proof that the top line is portable.

  1. Run fast-anything doctor, then scan the real slow command.
  2. Port one candidate and treat the generated recorded calls as regression evidence.
  3. Require verify to pass before enabling anything.
  4. Use bench to judge the end-to-end result, then keep or disable the port.

If profiling points at database access, HTTP requests, file reads, process startup or an inefficient algorithm spread across the application, stop. Fix the I/O pattern, query, cache policy or algorithm first. Rust around the wrong boundary can add maintenance work without changing the user-visible wait.

What we could not verify?

Public material does not establish how fast-anything performs on a particular production Python service, what percentage of arbitrary Python functions will qualify, or whether an agent will produce a maintainable Rust port on the first attempt. Those answers require a representative scan, the recorded-call verification output and an end-to-end benchmark on the application in question.

The repository publishes example results and detailed verification rules, but no independent third-party benchmark suite was identified here. An external reproducibility study, or performance data from the team operating the target application, would settle those claims more reliably.

Sources


David Thompson
David Thompson
David Thompson writes about AI tools, developer workflows, and the platforms powering automation.

Read more

Local News