hn.today

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

github.com73 points52 comments
Screenshot of Fast-Anything: Don't rewrite it in Rust. Rewrite the 5% that's slow

Fast-Anything is a performance tool built around the claim that most applications do not need a full rewrite in Rust: a small number of functions account for much of their runtime. It profiles programs, identifies promising functions, and helps a coding agent port selected functions to Rust while leaving the rest of the application intact. The workflow can run as one command or step by step: scan and rank functions, record real calls, generate a small Rust crate and porting instructions, verify the result, then enable or disable the replacement. It supports Python, JavaScript and TypeScript, Ruby, Java, Go, PHP, C, and C++, with language-specific bindings or a shared C interface.

Its emphasis is behavioral proof rather than assumed correctness. Verification replays up to 500 recorded calls, adds generated edge cases such as infinities, negative zero, non-ASCII strings, and altered input sizes, and checks that results and errors match the original; floating-point results may differ by at most 1e-9. A port is not enabled if it fails these checks or is slower once call overhead is included, and an environment variable can always restore the original implementation. Reported examples include Python fuzzy deduplication improving from 4.91 seconds to 42 milliseconds, while Java’s whole-app gain is 3× despite an 11× faster function because startup time remains. The tool also benchmarks whole applications and produces reports, making it useful for targeted optimization without replacing existing code.

Read on github.com52 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Big Data Is Dead

Big Data Is Dead

Big data is not the main obstacle to useful insights: hardware has kept pace with data growth, while teams still struggle to make sense of their information. The author argues that organizations should focus on making data easier to understand and use, rather than buying tools built for ever-larger datasets. (motherduck.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.