Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

fast-anything

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

EL4CTEO/fast-anything: Rust repository of the day on Trendshift

npm crates.io CI Python, Node, TypeScript, Ruby, Java, Kotlin, Go, PHP, C, C++, C#, R Claude Code plugin MCP server MIT or Apache-2.0

Most of an app's runtime sits in a few functions. fast-anything finds them, has your coding agent port only those to Rust, proves the port returns the same results on real recorded calls, and swaps it in. Reversible, one function at a time.

fast-anything go --agent claude -- python app.py

Install

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

The command is fast-anything. Scanning needs only your app's runtime; porting needs Rust (rustup). fast-anything doctor checks both.

Use

fast-anything go --agent claude -- python app.py

Use the command you normally run your app with (node app.ts, go run ., gradle run, dotnet run, …). --agent takes claude, codex or any command that reads a prompt on stdin.

Step by step:

commandwhat it does
scan [--] <cmd>profiles the app and ranks functions by time and portability
port [id]records real calls and creates a one-function Rust crate with a TASK.md
verifybuilds the port and replays every recorded call against it
enable / disableswitches the Rust in or out
benchtimes the whole app, original vs Rust, with an A/A noise control
reportmarkdown + SVG card for your PR
status / doctorwhere things stand / what's installed

Useful scan flags: --duration 30 for servers and GUIs, --calibrate to measure the profiler's overhead, --explain to check the setup without running. Commands with --json: scan, port, verify, enable, disable, bench, import, report, status, doctor.

Proof, not vibes

verify catches a wrong port

  • Every port is replayed against up to 500 real calls, plus edge cases (NaN, ±infinity, -0.0, empty, non-ASCII, bigger inputs) answered by the original.
  • Every 5th call is held out from the agent, so a port can't special-case what it was shown.
  • Nothing is enabled until all cases match, and a port that's slower per call stays off.
  • FAST_ANYTHING_DISABLE=1 runs the original any time.

Results

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

appbeforeafter
Python fuzzy dedupe4.91s42ms, 116×
PHP fuzzy dedupe2.94s53ms, 55×
Go fuzzy dedupe3.02s144ms, 21×
TypeScript fuzzy dedupe3.11s155ms, 20×
Ruby fuzzy dedupe3.13s228ms, 14×
C# fuzzy dedupe4.03s312ms, 13×
C mandelbrot431ms127ms, 3.4×
Java fuzzy dedupe3.50s1.18s, 3× (11× on the function; the rest is JVM startup)
C++ fuzzy dedupe3.02s1.09s, 2.7×

Note on reproducing these numbers: generated ports are multithreaded (they use available_parallelism), so whole-app speedups scale with the machine's thread count. The table above is from a 12-thread i5-10500. An independent reproduction of the Python fuzzy dedupe example on a 16-thread i7-11700 (Docker/Linux, Python 3.11, reference port) measured 5.23s → 16ms (337×, median of 5 rounds, A/A noise +2.0%), with all 33 replay cases matching the original.

It ports the outermost loop it can, so the app crosses into Rust once instead of millions of times.

Languages

languagehow it's run
Python 3.10+python app.py (PyO3)
JavaScript / TypeScriptnode 22+, bun, deno run -A (napi-rs)
Ruby 3.3+ruby app.rb
Java 22+java App.java, Maven, Gradle
Kotlin/JVMGradle, src/main/kotlin, JDK 22+
Go 1.22+go run .
PHP 8.1+php app.php (FFI extension)
C / C++gcc, clang, icx/icpx
C# / .NET 8+dotnet run -c Release
R 4.0+Rscript app.R

Python and JS/TS use native bindings; the rest call the port through one C entry point, with no headers or extra tools. It ports top-level, deterministic functions that take plain data (numbers, strings, lists, maps, arrays). scan says why anything else can't move yet.

Android

Android apps run on ART, so they're profiled on the device instead:

fast-anything scan --android com.example.app --duration 10

It ranks the app's own methods with simpleperf over adb (debuggable or profileable build). Device measurements (import gfxinfo, perfetto, simpleperf, json) go in the report in their own section. Ranking only: Android code isn't ported, and ART times are never compared with host ones.

Agents

  • Claude Code: /plugin marketplace add EL4CTEO/fast-anything, then /plugin install fast-anything@fast-anything
  • Codex: codex plugin marketplace add EL4CTEO/fast-anything
  • MCP server (any client): claude mcp add fast-anything -- fast-anything mcp
  • Skill: skills/fast-anything teaches any agent the loop

Contributors

Everyone who sent a pull request or reported an issue is in CONTRIBUTORS.md.

Contributors

Sponsors

fast-anything is free and open source. If it saves you time, sponsoring keeps it maintained.

Become a sponsor

License

Licensed under either of Apache License 2.0 or MIT, at your option.

关于 About

Don't rewrite it in Rust. Rewrite the 5% that's slow: profile your app, port the hot functions with your coding agent, prove they behave the same. Python, JS/TS, Ruby, Java, Kotlin, Go, PHP, C/C++, C#, R.
agent-skillsai-agentsclaude-codeclaude-code-plugincodexdeveloper-toolsffimcpmcp-servernapi-rsnodejsoptimizationperformanceprofilerpyo3pythonrewrite-it-in-rustrubyrusttypescript

语言 Languages

Rust74.6%
Python6.2%
JavaScript4.8%
Java2.8%
C#2.5%
PHP2.0%
Ruby1.7%
C++1.7%
R1.6%
C1.5%
Go0.6%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
269
Total Commits
峰值: 186次/周
Less
More

核心贡献者 Contributors