-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: Remove expensive reflection from raft/mesh hot path #16552
perf: Remove expensive reflection from raft/mesh hot path #16552
Conversation
This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks @lstoll 🙌🏻 🔥
Replaces a reflection-based copy of a struct in the mesh topology with a deep-copy generated implementation. This is in the hot-path of raft FSM updates, and the reflection overhead was a substantial part of mesh registration times (~90%). This could manifest as raft thread saturation, and resulting instability. Co-authored-by: Joel Brandhorst <[email protected]>
929c442
to
04b6a90
Compare
thank you @lstoll ! 🎉 |
Description
Replaces a reflection-based copy of a struct in the mesh topology with a deep-copy generated implementation.
This is in the hot-path of raft FSM updates, and the reflection overhead was a substantial part of mesh registration times (~90%). This could manifest as raft thread saturation, and resulting instability.
This is a similar problem/fix as #14934, it might be worth seeing if there are any other uses of the reflection copy library and replacing it with (generated) copies.
Fixes #16551
Testing & Reproduction steps
Details in issue #16551 . The before/after from the test case in that issue:
After the change was rolled out, we no longer saw any registration delays and the general raft/FSM thread saturation dropped off substantially
PR Checklist