Socket.IO 1.4.0 ship with new features like automatic compression for XHR and WebSockets, lots of bug fixes and significant performance and memory improvements.

Compression is enabled by default, as it’s highly beneficial for most application payloads. The following example shows the savings for a realtime stream of tweets.

The compression gains will vary by transport. For example, WebSocket defaults to a window size of 32kb when DEFLATE compression is enabled. Repeated occurrences of strings within that window will be compressed.The following demo (inspired by Julia Evans work) will highlight what the LZ77 algorithm de-duplicates from the traffic sent by the Twitter stream that matches javascript.

The memory overhead when compression is enabled is not inexistent, however. Make sure to account for a 300kb~ overhead per connection in terms of memory allocation. Read here about the parameters you can customize to change how much memory is allocated and how aggressively data is compressed.