-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feature] Improve afring throughput using code optimization #74
Merged
fako1024
merged 15 commits into
main
from
71-improve-afring-throughput-by-minimizing-individual-unsafe-casts
Sep 26, 2023
Merged
[feature] Improve afring throughput using code optimization #74
fako1024
merged 15 commits into
main
from
71-improve-afring-throughput-by-minimizing-individual-unsafe-casts
Sep 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…or constant values
…n goroutine to OS thread
fako1024
added
bug
Something isn't working
enhancement
New feature or request
performance
Performance / optimization related topics
labels
Sep 18, 2023
4 tasks
els0r
approved these changes
Sep 25, 2023
fako1024
deleted the
71-improve-afring-throughput-by-minimizing-individual-unsafe-casts
branch
September 26, 2023 06:35
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
enhancement
New feature or request
performance
Performance / optimization related topics
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@els0r Things done here:
unsafe
for all data fields, the portion of the TPacketHeaderV3 struct is cast directly (memory-aligned) and then worked with locallyPPOLL
loop and handling to focus on fast path (non-poll extraction from current active block) while improving code readabilityNextPayloadInPlace
to actually do what it's supposed to (instead of performing a zero-copy operation, which is why performance is "worse")Benchmarks (on three different systems) further below. The improvements for the non-zero-copy cases are nice to have, but they mostly serve as a consistency check that the performed changes are beneficial across the board (and that no regressions are introduced). Most important are the improvements for the
ZeroCopy
methods, which are in the range of 12-17% (depending on system), which, given the level of optimization we're looking at, is quite a lot:Closes #71