LearnBoost/engine.io — pull request #55 by EugenDueck (2012-08-08 00:18:58+00:00)
Title: implemented conflation

Also added some basic tests to ensure it works.

This works by taking the writeBuffer in socket.js, separating non-messages from messages, and giving an array of the data-part of the packaged message (i.e. the actual payload) to the conflater, which will return an array of messages.

Then the messages will be sent in this order:
* all non-messages
* the conflated messages

As mentioned in issue #45, there is room for optimization, if there's interest I'd prepare another pull-request. But this relates not only to the conflater, but, if I'm grokking the code correctly, also to a loss in efficiency that we'll get from going to current socket.io to the new one that'll use engine.io: Encoding of all messages once for every client, which will be noticeable in case of broadcasts and multicasts.

See also Marek Majkowski's (SockJS author) comment on this socket.io / sockjs performance benchmark: http://mrjoes.github.com/2011/12/15/sockjs-bench.html