-
Notifications
You must be signed in to change notification settings - Fork 3.4k
loadbalancer: Use unique for L3n4Addr #40633
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
Conversation
d58729d
to
dc559e2
Compare
/test |
dc559e2
to
f1acff4
Compare
/test |
/scale-100 |
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.
Thanks! Looks good to me from a clustermesh perspective, also I looked a bit the new implementation and lgtm too/seems pretty nice :D (although I don't know too well this part of the code 😅 )
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.
🚢
The L3n4Addr is used in a lot of places and is compared and hashed a lot. Reduce memory usage and speed up comparisons by making L3n4Addr a unique.Handle. pkg/loadbalancer/benchmark before: Min: Allocated 563043kB in total, 1837855 objects / 118158kB still reachable (per service: 36 objs, 11531B alloc, 2419B in-use) Avg: Allocated 583710kB in total, 2174642 objects / 154810kB still reachable (per service: 43 objs, 11954B alloc, 3170B in-use) Max: Allocated 643000kB in total, 3089878 objects / 263505kB still reachable (per service: 61 objs, 13168B alloc, 5396B in-use) After: Min: Allocated 510398kB in total, 1734286 objects / 83716kB still reachable (per service: 34 objs, 10452B alloc, 1714B in-use) Avg: Allocated 523617kB in total, 2188965 objects / 125627kB still reachable (per service: 43 objs, 10723B alloc, 2572B in-use) Max: Allocated 564751kB in total, 3478097 objects / 229608kB still reachable (per service: 69 objs, 11566B alloc, 4702B in-use) Signed-off-by: Jussi Maki <jussi@isovalent.com>
f1acff4
to
35f3d8d
Compare
/test |
Marking this as |
35f3d8d
to
089b870
Compare
Reverted the |
/test |
The L3n4Addr is used in a lot of places and is compared and hashed a lot. Reduce memory usage and speed up comparisons by making L3n4Addr a unique.Handle. In the
pkg/loadbalancer/benchmark
this is a 30% save on memory!The relevant change is to
pkg/loadbalancer/loadbalancer.go
, other files are changed just to accomodate the new API.pkg/loadbalancer/benchmark before:
After: