Commit Graph

9 Commits

Author SHA1 Message Date
Guillermo Rauch
0ae9a4fba6 prevent direct Buffer reference that breaks browserify 2014-09-04 10:14:23 +02:00
Guillermo Rauch
3cef88bc88 binary: reuse isBuf helper 2014-08-10 10:43:45 -07:00
Guillermo Rauch
0c755f93e4 clean up syntax 2014-08-10 10:43:00 -07:00
Kevin Roark
4e33d6a6c5 Less indentation and a small optimization
The optimization is the "else if" instead of "if" for checking
array in _removeBlobs. No need to iterate over keys of a blob.
2014-05-31 22:41:12 -07:00
Tony Kovanen
e2fb6e58c8 don't iterate keys of date objects 2014-05-24 19:33:30 +03:00
Kevin Roark
6d3218eb3a fix null reconstruction bug 2014-05-15 10:51:39 -04:00
Kevin Roark
ba64f07bca Removed has-binary-data dependency
And replaced it with better isBuf function. Has binary data would not have
checked objects that contain blobs. isBuf only checks the current object,
not its child objects
2014-03-05 00:20:52 -05:00
Kevin Roark
47df0694f5 Fixed the object check in binary.removeBlobs
Remove blobs has to iterate over a javascript object and asynchronously
remove the blobs / files. It does this by iterating over arrays and
objects in the larger object recursively.

Problem was in checking for object to iterate over, wasn't checking if
that object was binary data itself. So it was working, but really slowly,
by iterating over every byte in a Buffer and checking it for blobs.
Much faster now :)
2014-03-04 23:50:36 -05:00
Kevin Roark
299849b002 A faster and smaller binary parser and protocol
This is a squash of a few 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.

The remaining commits involved merging with actual socket.io-parser,
rather than the protocol repository. Oops.
2014-02-26 22:31:39 -05:00