Files
dotnet-runtime/src/libraries/System.Net.WebSockets.Client/tests
Stephen Toub 0ae9a42676 Use vectors in managed ClientWebSocket for mask application
The web socket protocol uses a 4-byte mask sent from client to server and xor'd with the payload data.  In the managed web socket implementation, that mask is currently applied byte-by-byte.  This commit changes it to be done using SIMD.

Micro-benchmarks on the ApplyMask function itself show a regression for payload lengths under 4 bytes, but above that it's a clear win:
```
1: 0.44x
3: 0.64x
4: 1.15x
7: 1.16x
31: 1.73x
32: 6.06x
63: 3.37x
64: 10.40x
1024: 20.36x
```
This doesn't have a measurable affect on small payloads in the overall context of sending/receiving data, but the larger the payload, the more it applies.  Locally I measured upwards of a 10% improvement for payloads several-K in size.


Commit migrated from https://github.com/dotnet/corefx/commit/c73b5ebc1eb92ae5b674fbfc3e871bfc61d2b4aa
2017-03-13 12:41:44 -04:00
..
2016-01-27 08:02:28 -08:00
2016-01-27 08:02:28 -08:00