-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: Use FxHasher
in places where we don't need DDoS resistance
#2342
Open
larseggert
wants to merge
28
commits into
mozilla:main
Choose a base branch
from
larseggert:feat-fxhasher
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
eab99c3
feat: Try FxHasher to see if it makes a difference
larseggert 0bda917
Merge branch 'main' into feat-fxhasher
larseggert 6762a02
More FxHasher
larseggert 93c8ce5
Merge branch 'main' into feat-fxhasher
larseggert 2b230a5
Merge branch 'main' into feat-fxhasher
larseggert 0d353a6
Merge branch 'main' into feat-fxhasher
larseggert 5879e28
Suggestion from @martinthomson
larseggert 6b305ea
One more
larseggert ee86d48
Merge branch 'main' into feat-fxhasher
larseggert bbea965
Merge branch 'main' into feat-fxhasher
larseggert bd06169
Suggestions from @mxinden
larseggert 7d6c181
Merge branch 'main' into feat-fxhasher
larseggert a78c1c6
IndexMap
larseggert 9d9a799
More
larseggert 13cdada
Again
larseggert d280b66
Again
larseggert 8d0b6fb
Undo
larseggert b609b9e
Merge branch 'main' into feat-fxhasher
larseggert 6e8d194
`swap_remove` -> `shift_remove`
larseggert 40c8383
`BTreeSet` -> `HashSet`
larseggert 420c6e2
Minimize
larseggert 97773c6
Minimize more
larseggert f4531aa
Merge branch 'main' into feat-fxhasher
larseggert fd081e4
Merge branch 'main' into feat-fxhasher
larseggert 9f9e220
Fix
larseggert 548027d
Merge branch 'main' into feat-fxhasher
larseggert 69a6710
Fix
larseggert bf294ed
Merge branch 'main' into feat-fxhasher
larseggert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Conceptually, why is an
IndexMap
faster than aHashMap
here? Both end up hashing the key, right?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.
It's not faster, it's possibly even slower. I made the change based on this comment: https://github.com/mozilla/neqo/pull/2342/files/bd061693b40e91b846c4d4cd1bc0ecfcd27c4e45#r1945509653
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.
Do I understand correctly that we want to be able to iterate
send_streams
and the like in order? Given thatHashMap
does not guarantee order, you are suggesting to useIndexMap
like we do inneqo-transport
.If so, the requirement for ordering might be worth documenting. It wasn't obvious to me.
In that case, preference for using
BTreeMap
, solely because it is instd
and only useIndexMap
in case it proves to be more performant thanBTreeMap
in a meaningful way.Given that
IndexMap
is a fairly small dependency, the above is not a strong opinion.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.
So I'm not completely sure that we need consistently ordered iteration here. We rely on that in the transport crate because we want frame sending to follow a predictable pattern (clear the old stuff out first). However, that's not something we rely on at this layer of the stack, so whatever is fastest might be the right answer.
Maybe the first question we have is whether we need (insertion-)ordered iteration over this collection?
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.
First, I think we should differentiate between RX and TX.
On RX (both here and in transport), I don't see a point in using anything that maintains order or has semantics that go beyond a simple map or set. I think all we do here is lookups based on received data.
On TX, (both here and in transport), do we really care that iteration is consistently ordered? All these data structures should mostly have a stable order while there are no insertions or removals. When there are, do we care that we'll have a different order afterwards? I can't convince myself that we do.
In other words, I think we should use whatever is fastest.
(Also, unrelated, I find the duplication/overlap between the transport and http3 crates really odd.)