Don't Rewrite in Rust — Just Optimize the 5% That's Slow

Fast-Anything says profile first to find the 5% hot spots, then optimize — not a full Rust rewrite.
Fast-Anything is an open-source project that sparked discussion on Hacker News. Its core argument: don't rewrite your whole project in Rust for performance — first find the ~5% of hot code that's actually slowing you down. Performance bottlenecks have a long-tail distribution, and local optimization has far lower change surface, regression risk, and verification cost than a full rewrite. The community is divided: supporters say full rewrites mask a lack of system understanding, while opponents cite runtime-level issues like GC pauses and concurrency models that local rewrites can't fix, plus the long-term cost of mixed tech stacks. Both sides agree rewrite decisions should be driven by profiling and benchmark data, not technical preference.

An open-source project called Fast-Anything has sparked discussion in the tech community, with a single core argument: don't rewrite your entire project in Rust for performance — first find the 5% that's actually slowing you down. The project earned 171 points and 136 comments on Hacker News, showing that the "should we rewrite?" question hits a real pain point for many developers.
The Other Side of the Rust Rewrite Trend
Over the past few years, "rewrite it in Rust" has become almost the default answer to any performance narrative. From command-line tools to infrastructure components, rewrite cases keep appearing in the community, and the language's memory safety and zero-cost abstractions are genuinely appealing.
But Fast-Anything offers a more pragmatic perspective: most projects' performance bottlenecks aren't evenly distributed across the codebase. The hot paths that actually consume time typically make up only a small fraction of the code, while the vast majority of remaining logic has negligible impact on overall performance. Rewriting all of that code together may only buy you higher maintenance costs and longer delivery cycles.
This judgment isn't new — the performance optimization field has long had a consensus of "measure first, then optimize." Fast-Anything's value lies in turning this into an actionable project form rather than leaving it at the level of principle.
Why the 5% Approach Works
Performance problems naturally have long-tail characteristics. In a single request's processing chain, 95% of the time might be spent on a few functions, a few serializations, a few memory allocations, while a large amount of business logic, boundary handling, and configuration parsing accounts for a tiny proportion.
Targeted optimization of these hot spots has a completely different payoff structure from a full rewrite: smaller change surface, controllable regression risk, and lower verification cost. Developers can use profiling tools to locate hot spots, then decide whether to use more efficient data structures, reduce copying, introduce caching, or rewrite just that small piece in Rust or another systems-level language.
In other words, Rust isn't being rejected — it's being put back in a more appropriate position: a tool for solving specific hot-spot problems, not a default global solution.
Profiling refers to collecting the call counts and time distribution of each function during program execution through sampling or instrumentation, thereby locating the actual hot paths. Common tools include perf on Linux, Python's cProfile, Go's pprof, and the cross-platform VTune. It answers "where is the time actually going," not "what looks slow."
Flame graphs are a visualization of profiling data, popularized by Brendan Gregg. The horizontal axis represents the width of the call stack (i.e., the proportion of time consumed), and the vertical axis represents call depth — the wider the frame, the more time that function occupies. The value of flame graphs is seeing the long-tail distribution at a glance: usually a few wide frames eat up most of the time, which aligns closely with the "5% hot spot" judgment. Developers can use this to decide what to optimize, avoiding gut-feel code changes.
Divergent Views in the Community
The 136 comments on Hacker News show that this argument isn't universally accepted. Supporters believe that full rewrites are often laziness in engineering decisions, using language migration to mask a lack of understanding of system behavior; profiling first and then acting is the responsible approach to your own code.
Opponents point out that real-world performance problems sometimes stem from overall runtime characteristics of the language — such as garbage collection pauses or concurrency model limitations — which are hard to solve through local rewrites, making full migration cleaner instead. Another common concern is the long-term cost of mixed tech stacks: two languages, two toolchains, two talent pools, and maintenance burden that accumulates over time.
Both views actually point to the same premise — rewrite decisions should be driven by measurement data, not technical preference. The only disagreement is whether the measurement results point to local optimization or full migration.
The "overall runtime characteristics" mentioned in the discussion deserve elaboration. GC pauses refer to managed languages suspending application threads during memory reclamation, which can cause tail-latency spikes for latency-sensitive services (such as trading or real-time communications); this overhead is spread globally and is hard to eliminate by rewriting a single function. Concurrency model limitations refer to constraints imposed by a language's built-in thread/coroutine model on throughput and scalability — for example, the GIL prevents certain compute-intensive workloads from utilizing multiple cores. Both are "architectural-level" costs, which is precisely the main reason opponents advocate full migration.
In contrast is the mixed tech stack cost: when a project uses two languages simultaneously, it must maintain two sets of dependency management, build processes, debugging and monitoring systems, and bear the data conversion overhead and security risks at the FFI (Foreign Function Interface) boundary. This cost doesn't appear immediately but accumulates linearly with team size and time, so it needs to be explicitly estimated in rewrite decisions.
Implications for Engineering Practice
Fast-Anything is more of a methodological reminder: before discussing language choice, first answer "where is it slow." Basic tools like profiling, benchmarking, and flame graphs often give answers faster than switching languages.
For individual projects and small teams, this approach can significantly lower the barrier to optimization; for large systems, it means rewrites can be broken down into smaller, more verifiable steps. As for what language to use to rewrite that 5%, it depends on the nature of the hot spot itself, not on community trends.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.