Add optimizations for connection & handshake#820
Conversation
160fcda to
4b744a7
Compare
6e083b7 to
ca3feea
Compare
|
Thanks for working on optimizing the library, really cool! Just a few comments on the draft so far: I don't know if we should export a new API with the Could you provide some benchmarks with before/after your optimizations? |
|
Our RTP library has
+1 for MarshalTo, but since we're planning to do major release for RTP soon, we can change it to something else. |
694ce4d to
1ebfd5b
Compare
|
@JoTurk Do you suggest to rename Just some heads up @theodorsm , we are doing handshakes at scale (>100k connections) and this change is reducing CPU usage significantly (50% spikes reductions, GC duration 80% down) - memory usage is smoother overall. However we have detected a leak so it makes bench-marking a bit tricky right now. I will definitely give more accurate numbers soon. |
36aa143 to
17e4f90
Compare
yeah |
f77901b to
cfa33b3
Compare
|
@theodorsm @JoTurk I have updated the API ^ Here is a 20h run. On the left the stable piece is with the proposed changes, on the right after 12h is when using |
|
Direction looks good to me, thank you so much for up streaming this btw. I'll need to review the details tho. |
09d21b8 to
169bbdd
Compare
|
@JoTurk I have fixed the tests, only the API break is being reported but this one should be ignored? |
No sadly, we can't break the API yet (We plan to do it with DTLS 1.3 is ready), we'll have to do a work around. or introduce another API. |
|
@noboruma Just a heads-up, we've started introducing breaking changes on main for DTLS 1.3, and we won't be cutting tags from main anytime soon until v4. If you're fine waiting, you can keep the breaking API and proceed with review and merging into main. If you'd prefer to get this feature into v3 now instead, feel free to re-target the PR to the dtls-1.2 branch. thank you. |

Description
Add
MarshalIntofunctions to allow for buffer pre-allocation of headersAdd pooling around timers
Avoid unnecessary copies in compact scenarios where the packets are already MTU size
Add cheap cache for MessageCertificate
Avoid unnecessary copy/allocations in Content ApplicationData