# fast-anything ports only the slow 5% of your app to Rust, and proves it behaves the same

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

> Hacker News story 50596155 · language: en · submitted 2026-11-22
> Web version: https://zeli.app/story/50596155
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 171 · by [BaselAshraf81](<https://news.ycombinator.com/user?id=BaselAshraf81>) · 💬 139
[original](<https://github.com/EL4CTEO/fast-anything>) · [HN discussion](<https://news.ycombinator.com/item?id=50596155>)

## Summary

Rewriting an entire app in Rust costs months of compile time and gigabytes of target/, yet most runtime lives in a handful of functions. fast-anything profiles a Python, Node, Ruby, Java, Go, PHP, or C/C++ app, has a coding agent port only the hot functions to Rust, then replays up to 500 recorded calls plus derived edge cases to confirm identical behavior before swapping it in. A Python fuzzy dedupe dropped from 4.91s to 42ms.

## Key quote

> That port looked right but compared bytes instead of characters. 148 of 500 real calls caught it.

## HN discussion (139 comments)

### [zodwick](<https://news.ycombinator.com/item?id=50599553>)

> I would like to argue that one could make most codebases 50% faster if rewritten from scratch with performance in mind even in the same language.
>
> Taking python as an example, one could use benefit of hindsight and make better decisions from the start ( offloading slow parts to C binaries, better DS decisions, eliminating bloat etc.. ) if they rewrite the same app in Python. This is kind of what happens when a program gets rewritten to another language ( Rust ) - better decisions are made from the start and less bloat is copied over.
>
> Yes, obviously there are exceptions to this. But most of the time it is the choices we make that make the program slow and not the language itself.
>
> It used to be that rewriting programs were almost always a dumb idea due to how much effort went into it - see: https://www.joelonsoftware.com/2000/04/06/things-you-should-... . But AI has made this argument less compelling imo. I now regularly rewrite big chunks of programs with various end goals given to the agent.

### [ThouYS](<https://news.ycombinator.com/item?id=50598795>)

> neat, but in my experience bottlenecks that you could solve this way are low hanging fruits and optimized away quickly.
>
> the true performance hog is like sand, spread across the system, a little bit in every place.

### [hendler](<https://news.ycombinator.com/item?id=50597812>)

> It's also OK to rewrite in Rust because it's not just about performance. The fast part in other Python, Ruby, etc may be written in C/C++, or call an external library, and be the vulnerable part.

### [alexfromapex](<https://news.ycombinator.com/item?id=50600839>)

> I didn't realize until I rewrote in Rust that psycopg2 is about as fast in Python as Rust database calls because it's all compiled in C. I had to do the full re-write because my code was going to live on customer machines and I didn't want them stealing IP. The speed, stability, and security boosts are just added bonuses.

### [osigurdson](<https://news.ycombinator.com/item?id=50600252>)

> I did an experiment to see how small and efficient I could make a desktop Linux app. One thing I learned is GPU adds a lot of memory overhead without much benefit for very basic apps.

### [the_arun](<https://news.ycombinator.com/item?id=50600908>)

> Java - “1.18s, 3× (11× on the function; the rest is JVM startup)” - why are we including JVM start up? Can’t we assume Java is already started? We don’t start JVM for every function. Right?

### [diegocg](<https://news.ycombinator.com/item?id=50597503>)

> Better yet, stop writing large codebases in lenguajes that will have performance troubles.

### [tialaramex](<https://news.ycombinator.com/item?id=50598547>)

> Note that this strategy only works if 5% of your software is the problem - because of Amdahl's law.

---

## Cite

- Page: https://zeli.app/story/50596155
- Date: 2026-11-22
- Source: github.com (https://github.com/EL4CTEO/fast-anything)
- Hacker News: https://news.ycombinator.com/item?id=50596155

## Other languages

- zh: https://zeli.app/zh/story/50596155 · markdown: https://zeli.app/zh/story/50596155.md
- ja: https://zeli.app/ja/story/50596155 · markdown: https://zeli.app/ja/story/50596155.md
- ko: https://zeli.app/ko/story/50596155 · markdown: https://zeli.app/ko/story/50596155.md
- de: https://zeli.app/de/story/50596155 · markdown: https://zeli.app/de/story/50596155.md
- es: https://zeli.app/es/story/50596155 · markdown: https://zeli.app/es/story/50596155.md
- ru: https://zeli.app/ru/story/50596155 · markdown: https://zeli.app/ru/story/50596155.md
