websocket: 200x faster generate mask#3204
Conversation
d5a1a46 to
25c9ceb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3204 +/- ##
==========================================
- Coverage 94.19% 94.16% -0.03%
==========================================
Files 90 90
Lines 24492 24513 +21
==========================================
+ Hits 23070 23083 +13
- Misses 1422 1430 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3145947 to
61fd2e8
Compare
|
You don't actually need the mask. You can just use a 0 mask. It's only necessary for browsers. |
|
I open end an issue for this over at ws some time ago. |
WebSocket is a browser spec, but it's also part of the RFC ;) |
|
Just saying. That's one place you could deviate and gain significant performance with no practical side effects. A zero mask is a noop when applied. |
|
I don't disagree that masking is pretty much useless, but I'd prefer to follow the spec at least until WebSocket is mature. Even then I'd prefer if it was opt-in behavior, similar to ws iirc, maybe via a WebSocketDispatcher or similar. |
Co-authored-by: Aras Abbasi <aras.abbasi@googlemail.com>
|
@mcollina ptal |
|
@mcollina ptal |
|
I think that using a non-cryptographically strong random number generator by default is not a wise decision.
Be prepared to receive security disclosures about this or add documentation to prevent them. |
|
Non-encrypted random number generation is for fallback when there is no cryptographic module. |
|
Oh, sorry, I did not notice that. Out of curiosity, when is the |
|
Ok, it's from the Node.js build. I thought |
The disadvantage is increased memory usage.