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

introduce a separate code paths for Short Header packet handling #3534

Merged
merged 8 commits into from
Aug 30, 2022

Conversation

marten-seemann
Copy link
Member

@marten-seemann marten-seemann commented Aug 29, 2022

Part of #3526.

This allows us to avoid the expensive code path of first parsing a wire.Header, then converting it into a wire.ExtendedHeader, which then has most of its field unset, since it can represent the entire complexity of a Long Header.

This change brings down the allocations for receiving data significantly.
In follow-up PRs, I'm planning to:

  • get rid of the wire.ShortHeader struct. The 4 fields could be return values, making sure that all allocations happen on the stack
  • improve the code path for sending short header packets

@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Base: 85.56% // Head: 85.47% // Decreases project coverage by -0.08% ⚠️

Coverage data is based on head (4f3d3b3) compared to base (3f1adfd).
Patch coverage: 84.58% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3534      +/-   ##
==========================================
- Coverage   85.56%   85.47%   -0.08%     
==========================================
  Files         137      138       +1     
  Lines       10087    10221     +134     
==========================================
+ Hits         8630     8736     +106     
- Misses       1080     1102      +22     
- Partials      377      383       +6     
Impacted Files Coverage Δ
qlog/event.go 98.11% <ø> (ø)
connection.go 76.85% <78.12%> (-0.80%) ⬇️
internal/wire/short_header.go 83.78% <83.78%> (ø)
packet_unpacker.go 86.73% <93.02%> (+0.70%) ⬆️
internal/utils/byteorder_big_endian.go 85.00% <100.00%> (+1.67%) ⬆️
internal/wire/header.go 87.88% <100.00%> (+0.15%) ⬆️
logging/multiplex.go 95.45% <100.00%> (+0.11%) ⬆️
qlog/packet_header.go 96.77% <100.00%> (+0.62%) ⬆️
qlog/qlog.go 91.13% <100.00%> (+0.35%) ⬆️
server.go 79.59% <100.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@marten-seemann marten-seemann merged commit 0b26365 into master Aug 30, 2022
@marten-seemann marten-seemann deleted the header-parsing branch August 30, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants