Skip to content
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

Refactor ipQueue to use generics #3894

Merged
merged 1 commit into from Feb 21, 2023
Merged

Refactor ipQueue to use generics #3894

merged 1 commit into from Feb 21, 2023

Conversation

neilalexander
Copy link
Member

@neilalexander neilalexander commented Feb 21, 2023

This refactors ipQueue to use Go generics. Since there are now considerably less interface boundaries, there should be far less small runtime allocations and less potential for nils to creep out by accident and cause panics during type assertions.

Signed-off-by: Neil Twigg neil@nats.io

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ripienaar
Copy link
Contributor

Are there any comparative benchmarks? Might be a non issue but generics do have some perf concerns

@neilalexander
Copy link
Member Author

Are there any comparative benchmarks? Might be a non issue but generics do have some perf concerns

I have ran a number of benchmarks on this branch vs main, this branch reduces allocations slightly but there's no change in throughput.

@derekcollison derekcollison merged commit baf2e47 into main Feb 21, 2023
@derekcollison derekcollison deleted the neil/ipqueue branch February 21, 2023 16:31
@gedw99
Copy link

gedw99 commented Mar 30, 2023

Nice work @neilalexander

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants