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

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

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

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.

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

    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.

  2. ThouYS

    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.

  3. hendler

    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.

  4. alexfromapex

    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.

  5. osigurdson

    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.

  6. the_arun

    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?

  7. diegocg

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

  8. tialaramex

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

More from this day

2026-11-22