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

Sent packets vec #1662

Merged
5 commits merged into from
Mar 19, 2024
Merged

Sent packets vec #1662

5 commits merged into from
Mar 19, 2024

Conversation

martinthomson
Copy link
Member

This is NOT faster than main and I don't quite understand why.

I'm putting this up so that I can get benchmarks (my machine doesn't produce anything useful).

If this line of investigation doesn't work out, I might try to salvage some of the cleanup that I did here.

@martinthomson martinthomson marked this pull request as ready for review February 15, 2024 23:43
@martinthomson martinthomson marked this pull request as draft February 15, 2024 23:44
@larseggert
Copy link
Collaborator

I don't understand why CI isn't running here. Force push to unstick it?

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (5074583) 92.93% compared to head (e4e45be) 92.93%.

Files Patch % Lines
neqo-transport/src/cc/classic_cc.rs 78.57% 6 Missing ⚠️
neqo-transport/src/recovery/mod.rs 92.15% 4 Missing ⚠️
neqo-transport/src/recovery/sent.rs 98.84% 3 Missing ⚠️
neqo-transport/src/path.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1662      +/-   ##
==========================================
- Coverage   92.93%   92.93%   -0.01%     
==========================================
  Files         119      121       +2     
  Lines       37260    37456     +196     
==========================================
+ Hits        34629    34811     +182     
- Misses       2631     2645      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@larseggert
Copy link
Collaborator

larseggert commented Mar 5, 2024

If I had to venture a guess why it's slower, it'd be because a BTreeMap holds a bunch of items contiguous in memory, whereas a VecDeque has each item in a different location in memory. So the BTreeMap should traverse faster.

From https://doc.rust-lang.org/std/collections/struct.VecDeque.html

Since VecDeque is a ring buffer, its elements are not necessarily contiguous in memory. If you want to access the elements as a single slice, such as for efficient sorting

Maybe a call to make_contiguous in a strategic place could help?

@larseggert larseggert closed this pull request by merging all changes into mozilla:main in 8e8972c Mar 19, 2024
@larseggert
Copy link
Collaborator

Argh! I followed the steps GitHub showed to merge main into this branch. Not sure what it did.

larseggert added a commit to larseggert/neqo that referenced this pull request Mar 19, 2024
Botched the "merge from main" on mozilla#1662. Reverted the merge. This PS
has the changes in mozilla#1662, rebased to main. Sorry for the mess.
@larseggert larseggert mentioned this pull request Mar 19, 2024
@larseggert
Copy link
Collaborator

Reverted and re-extracted the rebased PR into #1761. Sorry for the mess.

@martinthomson martinthomson mentioned this pull request May 7, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 7, 2024
* fix: Resurrect #1662

Botched the "merge from main" on #1662. Reverted the merge. This PS
has the changes in #1662, rebased to main. Sorry for the mess.

* Fix

* One-liner

* Merge main

* Merge main

* Move back to BTreeMap

* Tweak ordering

* More simplification/performance

* Test expectation fixup

* Update neqo-transport/src/cc/classic_cc.rs

Signed-off-by: Lars Eggert <lars@eggert.org>

* Apply suggestions from code review

Signed-off-by: Lars Eggert <lars@eggert.org>

---------

Signed-off-by: Lars Eggert <lars@eggert.org>
Co-authored-by: Lars Eggert <lars@eggert.org>
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.

3 participants