socketio / socket.io-protocol

Socket.IO Protocol specification
https://socket.io
507 stars 62 forks source link

A faster and smaller binary socket.io protocol #5

Closed kevin-roark closed 10 years ago

kevin-roark commented 10 years ago

This is a squash of 5 commits. Below is a small summary of commits.

Results from it: before the build size of socket.io-client was ~250K. Now it is ~215K. Tests I was doing here (https://github.com/kevin-roark/socketio-binaryexample/tree/speed-testing) take about 1/4 - 1/5 as long with this commit compared to msgpack.

The first was the initial rewrite of the encoding, which removes msgpack and instead uses a sequence of engine.write's for a binary event. The first write is the packet metadata with placeholders in the json for any binary data. Then the following events are the raw binary data that get filled by the placeholders.

The second commit was bug fixes that made the tests pass.

The third commit was removing unnecssary packages from package.json.

Fourth commit was adding nice comments, and 5th commit was merging upstream.

kevin-roark commented 10 years ago

This is in the wrong place. Oops.