-
Notifications
You must be signed in to change notification settings - Fork 79
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
Improve performance for inflight and payload queue #337
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #337 +/- ##
==========================================
+ Coverage 81.24% 81.52% +0.28%
==========================================
Files 49 51 +2
Lines 3247 3324 +77
==========================================
+ Hits 2638 2710 +72
- Misses 468 470 +2
- Partials 141 144 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Amazing! Those numbers are really exciting @cnderrauber Would it be possible to drop the dependency? |
fantastic improvement |
@Sean-Der It can be done by implementing a queue/ring buffer. Do we try to avoid all third-party dependency as possible or just concern this new imported dequeue? |
@cnderrauber I try and avoid all third-party dependencies. Currently we only have 3rd party dependencies for testing. Downstream breaking/doing unexpected things has been a problem |
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.
lgtm 🚀
Sounds good, will remove it |
Generate sorted slice is slow if the queue is large when data rate is high and some packets is lost/out-of-order. Use different queue struct for inflight and payload queue. Since inflight queue's chunk tsn is always consecutive so use a queue to hold chunks and it is always ordered. Use bitmask to hold payload tsn queue to calculate cumulative tsn and SACK.
d14afe7
to
bf38694
Compare
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.
lgtm! Awesome stuff @cnderrauber
Fix gap block in edge condition
Remove third-party dequeue
Add copyright
Remove panics in queue
The
payloadQueue.updateSortedKeys
costs more than 40% cpu time when send sctp packet at high rate with loss/out of order network. The function is frequently called to order the entire map to generate the sorted slice. This change uses individual queue structs for inflight and payload queue. The inflight queue's chunk tsn is always consecutive so use a queue to hold chunks and it is always ordered, and use bitmask to hold payload tsn queue to calculate cumulative tsn and SACK.Queue benchmark:
Use the sctp send/recv tester in a cpu limited receiver with 50ms rtt network , it also shows lower cpu usage and higher throughput: