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

websocket: optimize masking using WebAssembly #3273

Closed

Conversation

tsctx
Copy link
Member

@tsctx tsctx commented May 17, 2024

Closes #3265

https://github.com/tsctx/ws-masking

Script: https://github.com/nodejs/undici/blob/e0e786fabdd5063fb3986495a4bcdb82b5af5e0d/benchmarks/websocket/websocket-send-buffer.mjs

  • main
• send
------------------------------------------------- -----------------------------
ws          1'958 µs/iter   (1'672 µs … 6'897 µs)  1'956 µs  4'460 µs  6'897 µs
undici      1'926 µs/iter   (1'667 µs … 6'695 µs)  1'942 µs  3'954 µs  6'695 µs

summary for send
  undici
   1.02x faster than ws
  • this PR (under flag)
benchmark      time (avg)             (min … max)       p75       p99      p999
------------------------------------------------- -----------------------------
• send
------------------------------------------------- -----------------------------
ws          1'880 µs/iter   (1'587 µs … 6'713 µs)  1'870 µs  4'768 µs  6'713 µs
undici        901 µs/iter     (639 µs … 5'268 µs)    917 µs  3'044 µs  5'268 µs

summary for send
  undici
   2.09x faster than ws

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: delete this file

Copy link
Contributor

Autobahn Test Report

Summary

Type Count
OK 294
Failed 0
Non-Strict 4
Wrong Code 0
Unclean 0
Failed By Client 0
Informational 3
Unimplemented 216
Total Tests 517
Details
Test Case Behavior Close Behavior Duration Remote Close Code
1.1.1 OK OK 2 1000
1.1.2 OK OK 2 1000
1.1.3 OK OK 3 1000
1.1.4 OK OK 3 1000
1.1.5 OK OK 2 1000
1.1.6 OK OK 10 1000
1.1.7 OK OK 10 1000
1.1.8 OK OK 31 1000
1.2.1 OK OK 3 1000
1.2.2 OK OK 1 1000
1.2.3 OK OK 4 1000
1.2.4 OK OK 1 1000
1.2.5 OK OK 2 1000
1.2.6 OK OK 7 1000
1.2.7 OK OK 6 1000
1.2.8 OK OK 17 1000
2.1 OK OK 2 1000
2.2 OK OK 1 1000
2.3 OK OK 2 1000
2.4 OK OK 1 1000
2.5 OK OK 2 null
2.6 OK OK 33 1000
2.7 OK OK 1 1000
2.8 OK OK 1 1000
2.9 OK OK 1 1000
2.10 OK OK 4 1000
2.11 OK OK 21 1000
3.1 OK OK 1 null
3.2 OK OK 1 null
3.3 OK OK 1 null
3.4 OK OK 4 null
3.5 OK OK 1 null
3.6 OK OK 1 null
3.7 OK OK 1 null
4.1.1 OK OK 1 null
4.1.2 OK OK 1 null
4.1.3 OK OK 1 null
4.1.4 OK OK 1 null
4.1.5 OK OK 5 null
4.2.1 OK OK 1 null
4.2.2 OK OK 1 null
4.2.3 OK OK 2 null
4.2.4 OK OK 1 null
4.2.5 OK OK 4 null
5.1 OK OK 1 null
5.2 OK OK 1 null
5.3 OK OK 2 1000
5.4 OK OK 2 1000
5.5 OK OK 5 1000
5.6 OK OK 3 1000
5.7 OK OK 5 1000
5.8 OK OK 6 1000
5.9 OK OK 1 null
5.10 OK OK 1 null
5.11 OK OK 2 null
5.12 OK OK 3 null
5.13 OK OK 1 null
5.14 OK OK 1 null
5.15 OK OK 1 null
5.16 OK OK 1 null
5.17 OK OK 1 null
5.18 OK OK 1 null
5.19 OK OK 1002 1000
5.20 OK OK 1003 1000
6.1.1 OK OK 1 1000
6.1.2 OK OK 1 1000
6.1.3 OK OK 1 1000
6.2.1 OK OK 1 1000
6.2.2 OK OK 2 1000
6.2.3 OK OK 7 1000
6.2.4 OK OK 2 1000
6.3.1 OK OK 1 null
6.3.2 OK OK 2 null
6.4.1 NON-STRICT OK 2002 null
6.4.2 NON-STRICT OK 2002 null
6.4.3 NON-STRICT OK 2002 null
6.4.4 NON-STRICT OK 2002 null
6.5.1 OK OK 2 1000
6.5.2 OK OK 2 1000
6.5.3 OK OK 1 1000
6.5.4 OK OK 1 1000
6.5.5 OK OK 1 1000
6.6.1 OK OK 1 null
6.6.2 OK OK 1 1000
6.6.3 OK OK 1 null
6.6.4 OK OK 1 null
6.6.5 OK OK 4 1000
6.6.6 OK OK 1 null
6.6.7 OK OK 2 1000
6.6.8 OK OK 1 null
6.6.9 OK OK 2 1000
6.6.10 OK OK 1 null
6.6.11 OK OK 2 1000
6.7.1 OK OK 2 1000
6.7.2 OK OK 2 1000
6.7.3 OK OK 1 1000
6.7.4 OK OK 2 1000
6.8.1 OK OK 1 null
6.8.2 OK OK 1 null
6.9.1 OK OK 1 1000
6.9.2 OK OK 10 1000
6.9.3 OK OK 1 1000
6.9.4 OK OK 1 1000
6.10.1 OK OK 1 null
6.10.2 OK OK 1 null
6.10.3 OK OK 1 null
6.11.1 OK OK 1 1000
6.11.2 OK OK 2 1000
6.11.3 OK OK 2 1000
6.11.4 OK OK 1 1000
6.11.5 OK OK 1 null
6.12.1 OK OK 1 null
6.12.2 OK OK 1 null
6.12.3 OK OK 1 null
6.12.4 OK OK 1 null
6.12.5 OK OK 1 null
6.12.6 OK OK 1 null
6.12.7 OK OK 1 null
6.12.8 OK OK 1 null
6.13.1 OK OK 1 null
6.13.2 OK OK 1 null
6.13.3 OK OK 1 null
6.13.4 OK OK 1 null
6.13.5 OK OK 1 null
6.14.1 OK OK 1 null
6.14.2 OK OK 1 null
6.14.3 OK OK 1 null
6.14.4 OK OK 1 null
6.14.5 OK OK 1 null
6.14.6 OK OK 1 null
6.14.7 OK OK 1 null
6.14.8 OK OK 1 null
6.14.9 OK OK 1 null
6.14.10 OK OK 2 null
6.15.1 OK OK 1 null
6.16.1 OK OK 3 null
6.16.2 OK OK 1 null
6.16.3 OK OK 1 null
6.17.1 OK OK 1 null
6.17.2 OK OK 1 null
6.17.3 OK OK 1 null
6.17.4 OK OK 10 null
6.17.5 OK OK 1 null
6.18.1 OK OK 1 null
6.18.2 OK OK 1 null
6.18.3 OK OK 10 null
6.18.4 OK OK 1 null
6.18.5 OK OK 1 null
6.19.1 OK OK 1 null
6.19.2 OK OK 1 null
6.19.3 OK OK 2 null
6.19.4 OK OK 1 null
6.19.5 OK OK 1 null
6.20.1 OK OK 1 null
6.20.2 OK OK 1 null
6.20.3 OK OK 1 null
6.20.4 OK OK 1 null
6.20.5 OK OK 1 null
6.20.6 OK OK 1 null
6.20.7 OK OK 1 null
6.21.1 OK OK 1 null
6.21.2 OK OK 1 null
6.21.3 OK OK 1 null
6.21.4 OK OK 1 null
6.21.5 OK OK 1 null
6.21.6 OK OK 1 null
6.21.7 OK OK 1 null
6.21.8 OK OK 1 null
6.22.1 OK OK 1 1000
6.22.2 OK OK 1 1000
6.22.3 OK OK 1 1000
6.22.4 OK OK 1 1000
6.22.5 OK OK 2 1000
6.22.6 OK OK 1 1000
6.22.7 OK OK 2 1000
6.22.8 OK OK 1 1000
6.22.9 OK OK 1 1000
6.22.10 OK OK 2 1000
6.22.11 OK OK 1 1000
6.22.12 OK OK 2 1000
6.22.13 OK OK 2 1000
6.22.14 OK OK 13 1000
6.22.15 OK OK 2 1000
6.22.16 OK OK 1 1000
6.22.17 OK OK 6 1000
6.22.18 OK OK 1 1000
6.22.19 OK OK 4 1000
6.22.20 OK OK 1 1000
6.22.21 OK OK 1 1000
6.22.22 OK OK 4 1000
6.22.23 OK OK 1 1000
6.22.24 OK OK 1 1000
6.22.25 OK OK 1 1000
6.22.26 OK OK 1 1000
6.22.27 OK OK 2 1000
6.22.28 OK OK 2 1000
6.22.29 OK OK 1 1000
6.22.30 OK OK 1 1000
6.22.31 OK OK 2 1000
6.22.32 OK OK 1 1000
6.22.33 OK OK 1 1000
6.22.34 OK OK 2 1000
6.23.1 OK OK 1 1000
6.23.2 OK OK 2 1000
6.23.3 OK OK 1 1000
6.23.4 OK OK 1 1000
6.23.5 OK OK 1 1000
6.23.6 OK OK 1 1000
6.23.7 OK OK 2 1000
7.1.1 OK OK 8 1000
7.1.2 OK OK 1 1000
7.1.3 OK OK 1 1000
7.1.4 OK OK 1 1000
7.1.5 OK OK 1 1000
7.1.6 INFORMATIONAL INFORMATIONAL 11 1000
7.3.1 OK OK 2 null
7.3.2 OK OK 1 null
7.3.3 OK OK 1 1000
7.3.4 OK OK 1 1000
7.3.5 OK OK 1 1000
7.3.6 OK OK 1 null
7.5.1 OK OK 1 1007
7.7.1 OK OK 1 1000
7.7.2 OK OK 1 1001
7.7.3 OK OK 1 1002
7.7.4 OK OK 1 1003
7.7.5 OK OK 1 1007
7.7.6 OK OK 1 1008
7.7.7 OK OK 1 1009
7.7.8 OK OK 1 1010
7.7.9 OK OK 1 1011
7.7.10 OK OK 1 3000
7.7.11 OK OK 1 3999
7.7.12 OK OK 1 4000
7.7.13 OK OK 1 4999
7.9.1 OK OK 1 1002
7.9.2 OK OK 1 1002
7.9.3 OK OK 1 1002
7.9.4 OK OK 1 1002
7.9.5 OK OK 2 1002
7.9.6 OK OK 1 1002
7.9.7 OK OK 1 1002
7.9.8 OK OK 2 1002
7.9.9 OK OK 1 1002
7.13.1 INFORMATIONAL INFORMATIONAL 1 1002
7.13.2 INFORMATIONAL INFORMATIONAL 1 1002
9.1.1 OK OK 2 1000
9.1.2 OK OK 5 1000
9.1.3 OK OK 17 1000
9.1.4 OK OK 142 1000
9.1.5 OK OK 138 1000
9.1.6 OK OK 245 1000
9.2.1 OK OK 3 1000
9.2.2 OK OK 5 1000
9.2.3 OK OK 11 1000
9.2.4 OK OK 64 1000
9.2.5 OK OK 98 1000
9.2.6 OK OK 230 1000
9.3.1 OK OK 192 1000
9.3.2 OK OK 83 1000
9.3.3 OK OK 71 1000
9.3.4 OK OK 50 1000
9.3.5 OK OK 43 1000
9.3.6 OK OK 67 1000
9.3.7 OK OK 41 1000
9.3.8 OK OK 39 1000
9.3.9 OK OK 42 1000
9.4.1 OK OK 115 1000
9.4.2 OK OK 49 1000
9.4.3 OK OK 32 1000
9.4.4 OK OK 47 1000
9.4.5 OK OK 41 1000
9.4.6 OK OK 28 1000
9.4.7 OK OK 28 1000
9.4.8 OK OK 28 1000
9.4.9 OK OK 53 1000
9.5.1 OK OK 447 1000
9.5.2 OK OK 137 1000
9.5.3 OK OK 76 1000
9.5.4 OK OK 46 1000
9.5.5 OK OK 30 1000
9.5.6 OK OK 29 1000
9.6.1 OK OK 268 1000
9.6.2 OK OK 135 1000
9.6.3 OK OK 74 1000
9.6.4 OK OK 44 1000
9.6.5 OK OK 30 1000
9.6.6 OK OK 23 1000
9.7.1 OK OK 270 1000
9.7.2 OK OK 161 1000
9.7.3 OK OK 98 1000
9.7.4 OK OK 167 1000
9.7.5 OK OK 135 1000
9.7.6 OK OK 207 1000
9.8.1 OK OK 159 1000
9.8.2 OK OK 169 1000
9.8.3 OK OK 121 1000
9.8.4 OK OK 175 1000
9.8.5 OK OK 155 1000
9.8.6 OK OK 221 1000
10.1.1 OK OK 5 1000
12.1.1 UNIMPLEMENTED OK 1 1000
12.1.2 UNIMPLEMENTED OK 1 1000
12.1.3 UNIMPLEMENTED OK 1 1000
12.1.4 UNIMPLEMENTED OK 1 1000
12.1.5 UNIMPLEMENTED OK 1 1000
12.1.6 UNIMPLEMENTED OK 1 1000
12.1.7 UNIMPLEMENTED OK 1 1000
12.1.8 UNIMPLEMENTED OK 1 1000
12.1.9 UNIMPLEMENTED OK 1 1000
12.1.10 UNIMPLEMENTED OK 1 1000
12.1.11 UNIMPLEMENTED OK 1 1000
12.1.12 UNIMPLEMENTED OK 1 1000
12.1.13 UNIMPLEMENTED OK 1 1000
12.1.14 UNIMPLEMENTED OK 1 1000
12.1.15 UNIMPLEMENTED OK 1 1000
12.1.16 UNIMPLEMENTED OK 1 1000
12.1.17 UNIMPLEMENTED OK 1 1000
12.1.18 UNIMPLEMENTED OK 1 1000
12.2.1 UNIMPLEMENTED OK 1 1000
12.2.2 UNIMPLEMENTED OK 1 1000
12.2.3 UNIMPLEMENTED OK 1 1000
12.2.4 UNIMPLEMENTED OK 1 1000
12.2.5 UNIMPLEMENTED OK 1 1000
12.2.6 UNIMPLEMENTED OK 1 1000
12.2.7 UNIMPLEMENTED OK 1 1000
12.2.8 UNIMPLEMENTED OK 1 1000
12.2.9 UNIMPLEMENTED OK 1 1000
12.2.10 UNIMPLEMENTED OK 1 1000
12.2.11 UNIMPLEMENTED OK 1 1000
12.2.12 UNIMPLEMENTED OK 1 1000
12.2.13 UNIMPLEMENTED OK 1 1000
12.2.14 UNIMPLEMENTED OK 1 1000
12.2.15 UNIMPLEMENTED OK 1 1000
12.2.16 UNIMPLEMENTED OK 1 1000
12.2.17 UNIMPLEMENTED OK 1 1000
12.2.18 UNIMPLEMENTED OK 1 1000
12.3.1 UNIMPLEMENTED OK 1 1000
12.3.2 UNIMPLEMENTED OK 1 1000
12.3.3 UNIMPLEMENTED OK 1 1000
12.3.4 UNIMPLEMENTED OK 1 1000
12.3.5 UNIMPLEMENTED OK 1 1000
12.3.6 UNIMPLEMENTED OK 1 1000
12.3.7 UNIMPLEMENTED OK 1 1000
12.3.8 UNIMPLEMENTED OK 1 1000
12.3.9 UNIMPLEMENTED OK 1 1000
12.3.10 UNIMPLEMENTED OK 1 1000
12.3.11 UNIMPLEMENTED OK 1 1000
12.3.12 UNIMPLEMENTED OK 1 1000
12.3.13 UNIMPLEMENTED OK 1 1000
12.3.14 UNIMPLEMENTED OK 1 1000
12.3.15 UNIMPLEMENTED OK 1 1000
12.3.16 UNIMPLEMENTED OK 1 1000
12.3.17 UNIMPLEMENTED OK 1 1000
12.3.18 UNIMPLEMENTED OK 1 1000
12.4.1 UNIMPLEMENTED OK 1 1000
12.4.2 UNIMPLEMENTED OK 1 1000
12.4.3 UNIMPLEMENTED OK 1 1000
12.4.4 UNIMPLEMENTED OK 1 1000
12.4.5 UNIMPLEMENTED OK 1 1000
12.4.6 UNIMPLEMENTED OK 1 1000
12.4.7 UNIMPLEMENTED OK 2 1000
12.4.8 UNIMPLEMENTED OK 1 1000
12.4.9 UNIMPLEMENTED OK 1 1000
12.4.10 UNIMPLEMENTED OK 1 1000
12.4.11 UNIMPLEMENTED OK 1 1000
12.4.12 UNIMPLEMENTED OK 1 1000
12.4.13 UNIMPLEMENTED OK 1 1000
12.4.14 UNIMPLEMENTED OK 1 1000
12.4.15 UNIMPLEMENTED OK 1 1000
12.4.16 UNIMPLEMENTED OK 1 1000
12.4.17 UNIMPLEMENTED OK 1 1000
12.4.18 UNIMPLEMENTED OK 1 1000
12.5.1 UNIMPLEMENTED OK 1 1000
12.5.2 UNIMPLEMENTED OK 1 1000
12.5.3 UNIMPLEMENTED OK 1 1000
12.5.4 UNIMPLEMENTED OK 1 1000
12.5.5 UNIMPLEMENTED OK 1 1000
12.5.6 UNIMPLEMENTED OK 1 1000
12.5.7 UNIMPLEMENTED OK 1 1000
12.5.8 UNIMPLEMENTED OK 1 1000
12.5.9 UNIMPLEMENTED OK 1 1000
12.5.10 UNIMPLEMENTED OK 1 1000
12.5.11 UNIMPLEMENTED OK 1 1000
12.5.12 UNIMPLEMENTED OK 1 1000
12.5.13 UNIMPLEMENTED OK 4 1000
12.5.14 UNIMPLEMENTED OK 1 1000
12.5.15 UNIMPLEMENTED OK 1 1000
12.5.16 UNIMPLEMENTED OK 2 1000
12.5.17 UNIMPLEMENTED OK 1 1000
12.5.18 UNIMPLEMENTED OK 1 1000
13.1.1 UNIMPLEMENTED OK 1 1000
13.1.2 UNIMPLEMENTED OK 1 1000
13.1.3 UNIMPLEMENTED OK 1 1000
13.1.4 UNIMPLEMENTED OK 1 1000
13.1.5 UNIMPLEMENTED OK 1 1000
13.1.6 UNIMPLEMENTED OK 1 1000
13.1.7 UNIMPLEMENTED OK 1 1000
13.1.8 UNIMPLEMENTED OK 1 1000
13.1.9 UNIMPLEMENTED OK 1 1000
13.1.10 UNIMPLEMENTED OK 1 1000
13.1.11 UNIMPLEMENTED OK 1 1000
13.1.12 UNIMPLEMENTED OK 1 1000
13.1.13 UNIMPLEMENTED OK 1 1000
13.1.14 UNIMPLEMENTED OK 1 1000
13.1.15 UNIMPLEMENTED OK 1 1000
13.1.16 UNIMPLEMENTED OK 1 1000
13.1.17 UNIMPLEMENTED OK 1 1000
13.1.18 UNIMPLEMENTED OK 1 1000
13.2.1 UNIMPLEMENTED OK 1 1000
13.2.2 UNIMPLEMENTED OK 1 1000
13.2.3 UNIMPLEMENTED OK 1 1000
13.2.4 UNIMPLEMENTED OK 1 1000
13.2.5 UNIMPLEMENTED OK 1 1000
13.2.6 UNIMPLEMENTED OK 1 1000
13.2.7 UNIMPLEMENTED OK 1 1000
13.2.8 UNIMPLEMENTED OK 1 1000
13.2.9 UNIMPLEMENTED OK 1 1000
13.2.10 UNIMPLEMENTED OK 1 1000
13.2.11 UNIMPLEMENTED OK 1 1000
13.2.12 UNIMPLEMENTED OK 1 1000
13.2.13 UNIMPLEMENTED OK 1 1000
13.2.14 UNIMPLEMENTED OK 1 1000
13.2.15 UNIMPLEMENTED OK 1 1000
13.2.16 UNIMPLEMENTED OK 1 1000
13.2.17 UNIMPLEMENTED OK 1 1000
13.2.18 UNIMPLEMENTED OK 1 1000
13.3.1 UNIMPLEMENTED OK 1 1000
13.3.2 UNIMPLEMENTED OK 1 1000
13.3.3 UNIMPLEMENTED OK 1 1000
13.3.4 UNIMPLEMENTED OK 1 1000
13.3.5 UNIMPLEMENTED OK 1 1000
13.3.6 UNIMPLEMENTED OK 1 1000
13.3.7 UNIMPLEMENTED OK 1 1000
13.3.8 UNIMPLEMENTED OK 1 1000
13.3.9 UNIMPLEMENTED OK 1 1000
13.3.10 UNIMPLEMENTED OK 1 1000
13.3.11 UNIMPLEMENTED OK 1 1000
13.3.12 UNIMPLEMENTED OK 1 1000
13.3.13 UNIMPLEMENTED OK 1 1000
13.3.14 UNIMPLEMENTED OK 1 1000
13.3.15 UNIMPLEMENTED OK 1 1000
13.3.16 UNIMPLEMENTED OK 1 1000
13.3.17 UNIMPLEMENTED OK 1 1000
13.3.18 UNIMPLEMENTED OK 1 1000
13.4.1 UNIMPLEMENTED OK 1 1000
13.4.2 UNIMPLEMENTED OK 1 1000
13.4.3 UNIMPLEMENTED OK 1 1000
13.4.4 UNIMPLEMENTED OK 1 1000
13.4.5 UNIMPLEMENTED OK 1 1000
13.4.6 UNIMPLEMENTED OK 1 1000
13.4.7 UNIMPLEMENTED OK 1 1000
13.4.8 UNIMPLEMENTED OK 1 1000
13.4.9 UNIMPLEMENTED OK 1 1000
13.4.10 UNIMPLEMENTED OK 1 1000
13.4.11 UNIMPLEMENTED OK 1 1000
13.4.12 UNIMPLEMENTED OK 1 1000
13.4.13 UNIMPLEMENTED OK 1 1000
13.4.14 UNIMPLEMENTED OK 1 1000
13.4.15 UNIMPLEMENTED OK 1 1000
13.4.16 UNIMPLEMENTED OK 1 1000
13.4.17 UNIMPLEMENTED OK 1 1000
13.4.18 UNIMPLEMENTED OK 1 1000
13.5.1 UNIMPLEMENTED OK 1 1000
13.5.2 UNIMPLEMENTED OK 1 1000
13.5.3 UNIMPLEMENTED OK 1 1000
13.5.4 UNIMPLEMENTED OK 1 1000
13.5.5 UNIMPLEMENTED OK 1 1000
13.5.6 UNIMPLEMENTED OK 1 1000
13.5.7 UNIMPLEMENTED OK 1 1000
13.5.8 UNIMPLEMENTED OK 1 1000
13.5.9 UNIMPLEMENTED OK 1 1000
13.5.10 UNIMPLEMENTED OK 1 1000
13.5.11 UNIMPLEMENTED OK 1 1000
13.5.12 UNIMPLEMENTED OK 1 1000
13.5.13 UNIMPLEMENTED OK 1 1000
13.5.14 UNIMPLEMENTED OK 1 1000
13.5.15 UNIMPLEMENTED OK 1 1000
13.5.16 UNIMPLEMENTED OK 1 1000
13.5.17 UNIMPLEMENTED OK 1 1000
13.5.18 UNIMPLEMENTED OK 1 1000
13.6.1 UNIMPLEMENTED OK 1 1000
13.6.2 UNIMPLEMENTED OK 2 1000
13.6.3 UNIMPLEMENTED OK 1 1000
13.6.4 UNIMPLEMENTED OK 1 1000
13.6.5 UNIMPLEMENTED OK 1 1000
13.6.6 UNIMPLEMENTED OK 1 1000
13.6.7 UNIMPLEMENTED OK 1 1000
13.6.8 UNIMPLEMENTED OK 1 1000
13.6.9 UNIMPLEMENTED OK 1 1000
13.6.10 UNIMPLEMENTED OK 1 1000
13.6.11 UNIMPLEMENTED OK 1 1000
13.6.12 UNIMPLEMENTED OK 1 1000
13.6.13 UNIMPLEMENTED OK 1 1000
13.6.14 UNIMPLEMENTED OK 1 1000
13.6.15 UNIMPLEMENTED OK 1 1000
13.6.16 UNIMPLEMENTED OK 1 1000
13.6.17 UNIMPLEMENTED OK 1 1000
13.6.18 UNIMPLEMENTED OK 1 1000
13.7.1 UNIMPLEMENTED OK 1 1000
13.7.2 UNIMPLEMENTED OK 1 1000
13.7.3 UNIMPLEMENTED OK 1 1000
13.7.4 UNIMPLEMENTED OK 1 1000
13.7.5 UNIMPLEMENTED OK 1 1000
13.7.6 UNIMPLEMENTED OK 1 1000
13.7.7 UNIMPLEMENTED OK 1 1000
13.7.8 UNIMPLEMENTED OK 1 1000
13.7.9 UNIMPLEMENTED OK 1 1000
13.7.10 UNIMPLEMENTED OK 1 1000
13.7.11 UNIMPLEMENTED OK 1 1000
13.7.12 UNIMPLEMENTED OK 1 1000
13.7.13 UNIMPLEMENTED OK 1 1000
13.7.14 UNIMPLEMENTED OK 1 1000
13.7.15 UNIMPLEMENTED OK 1 1000
13.7.16 UNIMPLEMENTED OK 1 1000
13.7.17 UNIMPLEMENTED OK 1 1000
13.7.18 UNIMPLEMENTED OK 1 1000

Copy link
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right way for WebSocket to move in.

@tsctx
Copy link
Member Author

tsctx commented May 17, 2024

closed/

@tsctx tsctx closed this May 17, 2024
@tsctx tsctx deleted the websocket/optimize-masking-using-wasm branch May 17, 2024 16:10
@KhafraDev
Copy link
Member

@lpinca I'm not sure if you'd be interested in this or not.

@lpinca
Copy link
Member

lpinca commented May 18, 2024

It is nice for portability but bufferutil seems to be faster in all cases.

@tsctx
Copy link
Member Author

tsctx commented May 18, 2024

Since it must be copied to the memory area, bufferutil, which does not copy, has the advantage.

@lpinca
Copy link
Member

lpinca commented May 18, 2024

Now that WebSocket is in Node.js core, we could add a Buffer.mask() and Buffer.unmask() implementation using SIMD instructions and exposing it for public usage similarly to how it was done for Buffer.isUtf8().

cc: @lemire @anonrig

Edit: Buffer.unmask() is not strictly needed. It is the same thing.

@lemire
Copy link
Member

lemire commented May 19, 2024

@lpinca Can you provide the specification for the functions?

@KhafraDev
Copy link
Member

@lpinca
Copy link
Member

lpinca commented May 19, 2024

@lemire for a possible API see https://github.com/websockets/bufferutil?tab=readme-ov-file#bufferutilmasksource-mask-output-offset-length. The last 3 parameters can be optional.

@lemire
Copy link
Member

lemire commented May 19, 2024

@lpinca @KhafraDev Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimization of websocket masking
4 participants