<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux" -->

---
title: Fast-Anything: Don't rewrite it in Rust. Rewrite the 5%...
description: fast-anything is a CLI tool that profiles Python, Node, Ruby, Java, Go, PHP, C, C++ or C# apps, finds the slowest functions, and has a coding agent port just...
canonical: https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow | daily.dev
og:description: fast-anything is a CLI tool that profiles Python, Node, Ruby, Java, Go, PHP, C, C++ or C# apps, finds the slowest functions, and has a coding agent port just...
og:url: https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux
og:image: https://api.daily.dev/og/posts/4CjeTDXUX.png
og:image:alt: Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow

**[Hacker News](https://daily.dev/sources/hn)** · 6 min read · 14 upvotes · 1 comments

## Summary

fast-anything is a CLI tool that profiles Python, Node, Ruby, Java, Go, PHP, C, C++ or C# apps, finds the slowest functions, and has a coding agent port just those to Rust. It records up to 500 real calls to verify the port gives the same results before swapping it in, and the swap is fully reversible. Benchmarks show a Python fuzzy dedupe speeding up 116x (4.91s to 42ms) and PHP fuzzy dedupe 55x (2.94s to 53ms). It ships as an npm package, a crates.io crate, a Claude Code plugin and an MCP server with 8 tools.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/EL4CTEO/fast-anything>

## Questions this post answers

### How much faster can porting just the hot function in a Python app to Rust make it?

A Python fuzzy dedupe benchmark on 700 names went from 4.91 seconds to 42 milliseconds, a 116x speedup, by porting only the slowest function to Rust rather than rewriting the whole app. Similar results were measured across other languages: PHP improved 55x, Go 21x, and TypeScript 20x on comparable fuzzy dedupe workloads.

_Weighing a partial Rust rewrite versus a full one? daily.dev surfaces benchmarks like this for that exact tradeoff._

### How does fast-anything verify that a Rust port behaves the same as the original function?

It records up to 500 real calls to the original function, replays them against the Rust port, and also generates edge cases like NaN, infinity, empty inputs, and shrunk random slices. Nothing gets enabled until every case matches within 1e-9 for floats and errors match where the original errors; in one case 148 of 500 calls caught a byte-versus-character comparison bug.

_Developers verifying auto-generated code changes track tools like this via daily.dev before trusting them in production._

### Which languages can have functions ported to Rust for speed with fast-anything?

It supports Python 3.10+, JavaScript/TypeScript on Node 22+, Ruby 3.3+, Java 22+, Go 1.22+, PHP 8.1+, C and C++, and C#/.NET 8+. Each uses a different binding, such as PyO3 for Python, napi-rs for Node, and a shared C bridge through FFI, cgo, or NativeLibrary for the others.

_Picking a language-specific optimization path? daily.dev keeps polyglot performance tooling like this in view._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 139 comments across hackernews (as of 2026-11-22).

**TL;DR:** The discussion largely debates whether rewriting hot paths in Rust (or any compiled language) is really the main lever for speed, with many arguing that algorithmic choices, data structures, and architecture matter more than language, while others share real-world cases where partial Rust rewrites delivered big wins.

**Sentiment:** 15% positive · 55% mixed · 30% skeptical

**The case for**

- Several people shared concrete cases (Python/PHP/TS pipelines) where moving hot code to Rust gave 10x-100x speedups.
- Some note Rust's strict static analysis and type system pair well with LLM-driven code generation, catching mistakes humans/agents would miss.
- A few argue rewriting for Rust also brings security/memory-safety benefits beyond raw speed.

**The pushback**

- Many argue that most slowness comes from bad algorithms, data structures, or architecture (e.g. I/O, DB, bloat) rather than language choice, so targeted rewrites may not help as much as claimed.
- Some are skeptical the 'slow 5%' pattern is realistic, arguing performance problems are often spread thinly across a codebase like 'sand' rather than concentrated in a few functions.
- Commenters note Rust's build times, compiler resource usage, and async/concurrency pitfalls (e.g. misuse of tokio/Rayon) can offset gains or even hurt performance if done carelessly.
- A few dismiss Rust rewrites as trend-driven or 'virtue signaling' rather than substantively needed in many cases.
- One commenter pointed out the benchmark choice of rewriting existing C/C++ code into Rust for 'performance' seems odd/contradictory.

**By community**

- hackernews (mixed): A long, technical thread debates whether language choice or algorithmic/architectural decisions matter more for performance, with real anecdotes supporting both big Rust wins and skepticism about the tool's core premise.

**Hottest debate:** Whether performance problems are typically concentrated enough in a small 'slow 5%' to make targeted rewrites worthwhile, versus being diffusely spread across architecture, algorithms, and data structures.

**Open questions**

- Does the tool's hotspot-detection approach generalize to codebases where slowness is distributed rather than concentrated in a few functions?
- How does the tool handle cases where 'fast' languages like Rust are misused (e.g. async/concurrency pitfalls) in the generated code?
- Why does the benchmark include rewriting existing C/C++ code into Rust for performance gains?

**Highlights**

> """If you're looking for the next win, you don't have a hotspot. The CPU profile might look even-Stevens across the board. Let me give you a really simple example of this, I used to work on the [Edge] browser and you could find yourself with a significant regression one week and you're using way more CPU, and you look what the functions are and it's the same functions as always. It's layout and it's style computation, and that code hasn't changed a byte. It's the same excellent layout engine, it's the same excellent style engine, and yet the profiler will tell you you're spending way more time in layout. What's happened? Somewhere in your code is a little whammy where someone invalidated a bunch of tree nodes which took about 8 nanoseconds and caused the layout engine to now do tons of computation that it didn't have to do before. No profiler in the world is going to save you from this problem, it's going to tell you that the problem is in the layout code. Well duh, thanks for that, of course the compute is in the layout code, it's always in the layout code, all we do is layout and draw. So I have to find the 3 nanoseconds where somebody invalidated something that they have no business invalidating because it's wrong. And the way you fix that is [to have a sense of how to check that you're invalidating the right thing, regression testing, planning] and it could be literally 4 or 5 instructions dirtying the cache and that's not going to show up in a profile. [paraphrasing; Casey: if you've developed the whole browser without caring about this, at the end you're going to find it very slow and not be able to squeeze any more performance out of the layout engine? Rico: Right, this is not something you can fix at the finish line, it needs a plan]""" - Rico Mariani, interview: https://youtu.be/48Rig6v-xYU?t=3615
> — [jodrellblank on hackernews · 1 comments](https://news.ycombinator.com/item?id=50599870)

> This cope was common 20 years ago with Python. It rarely worked out. It's rare that 5% of your program is taking up that large a percentage of your execution. It's usually much more spread out than that. Also, we have LLMs now. Rust should be the default for many things.
> — [searealist on hackernews · 1 comments](https://news.ycombinator.com/item?id=50598784)

> The results section feels a bit like a joke. They rewrote C and C++ to Rust for performance? And something tells me C# and Java could have gotten 90% of the improvement without any rewrite. I'll have to try later today.
> — [Bolwin on hackernews · 1 comments](https://news.ycombinator.com/item?id=50599237)

> I recently built a small nextjs/node application that basically makes like $50 usd monthly. Initially built as a PoC, I wanted to place it in a vps so that I didn't have to maintain it in my home laptop, and also because I wanted to move it to a Europe location for better business performance [im in mexico and latency is high]. Thing is, the TS app weighted around 4GB overall and took 2s to do its thing. [A backend process, an http api and a static website generator]. I needed to decrease the size and increase performance dramatically,to be able to put it in a 2GB 2vcpu instance, which costs $12 monthly. Otherwise it would eat the profit. Claude ported it to Rust, in around 2 days total. And it went down to 1.5Gb max, and 1/10 of the CPU usage. Now it sits in the aws europe zone making money.
> — [xtracto on hackernews · 2 comments](https://news.ycombinator.com/item?id=50599680)

> As far as I can tell, the only reason people rewrite things in Rust is so that they can make HN posts about rewriting a thing in Rust that didn't need rewriting in the first place.
> — [caymanjim on hackernews](https://news.ycombinator.com/item?id=50603287)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50596155) · 163 points · 139 comments

## Community discussion

Top comments from developers on daily.dev.

**@pdfopsdev** · 2 upvotes

> capturing 500 real calls to verify parity is smart but it'll miss anything nondeterministic, random seeds, dict ordering quirks, floating point rounding differences between python and rust. curious how it handles a function that's technically correct but rounds differently.

## Similar posts on daily.dev

- [Writing Rust code that's faster than state-of-the-art libraries by asking agents to make the code faster](https://daily.dev/posts/writing-rust-code-that-s-faster-than-state-of-the-art-libraries-by-asking-agents-to-make-the-code-fa-886d02uwp) · Max Woolf's Blog · 0 upvotes · 0 comments
- [Software is slow because of bad design, not slow languages](https://daily.dev/posts/software-is-slow-because-of-bad-design-not-slow-languages-qnqp1oxqm) · sean goedecke · 11 upvotes · 4 comments
- [The Optimization Ladder](https://daily.dev/posts/the-optimization-ladder-jor2sohos) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#rust](https://daily.dev/tags/rust), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow","url":"https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux"},"datePublished":"2026-11-22T13:55:49.529Z","dateModified":"2026-11-22T21:27:20.103Z","description":"fast-anything is a CLI tool that profiles Python, Node, Ruby, Java, Go, PHP, C, C++ or C# apps, finds the slowest functions, and has a coding agent port just...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e436cd03e493eaacc3684b3100cbafa8?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e436cd03e493eaacc3684b3100cbafa8?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":11},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"ai-agents,rust,claude-code","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux","comment":[{"@type":"Comment","text":"capturing 500 real calls to verify parity is smart but it’ll miss anything nondeterministic, random seeds, dict ordering quirks, floating point rounding differences between python and rust. curious how it handles a function that’s technically correct but rounds differently.","datePublished":"2026-11-22T18:01:13.895Z","url":"https://daily.dev/posts/4CjeTDXUX#c-5aYUL7tkz","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/fast-anything-don-t-rewrite-it-in-rust-rewrite-the-5-that-s-slow-4cjetdxux#faq","mainEntity":[{"@type":"Question","name":"How much faster can porting just the hot function in a Python app to Rust make it?","acceptedAnswer":{"@type":"Answer","text":"A Python fuzzy dedupe benchmark on 700 names went from 4.91 seconds to 42 milliseconds, a 116x speedup, by porting only the slowest function to Rust rather than rewriting the whole app. Similar results were measured across other languages: PHP improved 55x, Go 21x, and TypeScript 20x on comparable fuzzy dedupe workloads. Weighing a partial Rust rewrite versus a full one? daily.dev surfaces benchmarks like this for that exact tradeoff."}},{"@type":"Question","name":"How does fast-anything verify that a Rust port behaves the same as the original function?","acceptedAnswer":{"@type":"Answer","text":"It records up to 500 real calls to the original function, replays them against the Rust port, and also generates edge cases like NaN, infinity, empty inputs, and shrunk random slices. Nothing gets enabled until every case matches within 1e-9 for floats and errors match where the original errors; in one case 148 of 500 calls caught a byte-versus-character comparison bug. Developers verifying auto-generated code changes track tools like this via daily.dev before trusting them in production."}},{"@type":"Question","name":"Which languages can have functions ported to Rust for speed with fast-anything?","acceptedAnswer":{"@type":"Answer","text":"It supports Python 3.10+, JavaScript/TypeScript on Node 22+, Ruby 3.3+, Java 22+, Go 1.22+, PHP 8.1+, C and C++, and C#/.NET 8+. Each uses a different binding, such as PyO3 for Python, napi-rs for Node, and a shared C bridge through FFI, cgo, or NativeLibrary for the others. Picking a language-specific optimization path? daily.dev keeps polyglot performance tooling like this in view."}}]}
```

