-
Notifications
You must be signed in to change notification settings - Fork 49
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
Use speedy XOR from pion/transport #211
Conversation
Codecov Report
@@ Coverage Diff @@
## master #211 +/- ##
==========================================
- Coverage 76.54% 76.31% -0.24%
==========================================
Files 17 17
Lines 1232 1220 -12
==========================================
- Hits 943 931 -12
Misses 198 198
Partials 91 91
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
go.mod
Outdated
@@ -6,6 +6,6 @@ require ( | |||
github.com/pion/logging v0.2.2 | |||
github.com/pion/rtcp v1.2.9 | |||
github.com/pion/rtp v1.7.13 | |||
github.com/pion/transport v0.13.0 | |||
github.com/pion/transport v0.13.1-0.20220609023836-26aa3f6dca85 |
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.
I'm not sure if this is desirable. Do we need to wait for @Sean-Der to 'prod' pion/transport to v0.13.1 so we're referencing a release instead of a dated commit?
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.
Yes, I think so.
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.
I've now pushed the v0.13.1 tag to pion/transport. Can you try fixing up go.mod accordingly and we'll see if that works?
Now that we have a speedy version of xorBytes in pion/transport, we might as well use it. Benchmarks indicate an improvement of 10% to 20% in CTR encryption speed for large blocks, depending on the architecture. Also remove TestXorBytesBuffer, which is no longer relevant.
I've now pushed the v0.13.1 tag to pion/transport. Can you try fixing up go.mod
accordingly and we'll see if that works?
Done.
|
Now that we have a speedy version of xorBytes in pion/transport, we might as well use it. Benchmarks indicate an improvement of 10% to 20% in CTR encryption speed for large blocks, depending on the architecture.
The semantics of xor.XorBytes is a little bit different from the previous version — it panics if the destination is too short, while the previous version used to truncate the output. As far as I can tell, we never call it with a too small destination, we always use GrowBuffer beforehand. I've removed XorTestBufferSize, which was testing this behaviour; if any further tests are necessary, they should go into the xor package.