Profile Before Rewriting: Find the Real Performance BottleneckProfile Before Rewriting: Find the Real Performance Bottleneck
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Rewriting in Rust won't fix a slow app, profiling will. Sean Goedecke's post this week says software is slow because of design, not language. The Lobsters thread answers with people who rewrote Ruby or Python services in C# and cut their server count. Both are right, and they're talking about different apps. Most of what I build is scrapers, PDF extraction and APIs in Python, and the profile usually says the same thing: the process is waiting on the network or on a database that gets called once per row. The wins come from running requests concurrently, caching what doesn't change and turning twenty queries into one. Python's share of the wall clock is rarely what I fix first. When CPU is the bottleneck, the heavy part already runs in C: the OCR, the PDF parsing, the model. A rewrite earns its cost on the hot loop the profile points at, and almost never on the whole program. If you've rewritten a service in a faster language, did you profile the old one first, and what did it blame?
Joe's avatar
The article: https://www.seangoedecke.com/software-is-slow-because-of-bad-design-not-slow-languages and the thread: https://lobste.rs/s/hd72yt/software_is_slow_because_bad_design_not
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started