Performance PRs: profile before you optimize #331
domcyrus
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A note for current and prospective contributors.
RustNet aims to stay small and fast, and "fast" attracts performance PRs. Those are welcome — but I want to be explicit about the bar, so we do not spend each other's time on changes that look faster in a microbenchmark but do not move the needle in practice.
The core issue: a microbenchmark proves a function got faster in isolation. It says nothing about whether that function is hot enough to matter for overall runtime. Optimizing a cold path (connection setup, one-time parsing, error handling) just adds review and maintenance cost for no real gain.
What I ask for a performance-motivated PR:
cargo bench/ criterion comparison showing your change is faster is genuinely useful and welcome — it just does not, on its own, establish that the code is on a hot path.The same guidance is now captured in CONTRIBUTING.md under "Performance & Optimizations" (EN and zh-CN).
Feedback on this is welcome.
Beta Was this translation helpful? Give feedback.
All reactions