netty/netty — pull request #2955 by Matthias247 (2014-10-01 22:38:55+00:00)
Title: Improve WebSocket performance

Motivation:

Websocket performance is to a large account determined through the masking
and unmasking of frames. The current behavior of this in Netty can be
improved.

Modifications:

Perform the XOR operation not bytewise but in int blocks as long as
possible. This reduces the number of necessary operations by 4. Also don't
read the writerIndex in each iteration.

Result:

A large performance gain (up to 50%) in websocket throughput.

Test results using the benchmark from #2954:

Before:

![](http://abload.de/img/before77jwj.png)

After:
![](http://abload.de/img/aftery7jr7.png)