Binary handling for websocket frames. #1

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@cstar
cstar commented Sep 17, 2010

Bonjour Roberto,

Instead of converting to and from lists, everything is now handled in binary.

Cheers!

@cstar cstar Websocket parsing now in binary.
(Given the frame format change in hixie-draft-01, it will also be better for the new frame parsing)
dbc203f
@ostinelli
Owner

hi eric!

first of all thank you very much for this request.

only thing is, i am not keen towards using binary instead of lists. according to my benchmarks, the use of binary [for instance using the http_bin option] does not improve the overall misultin performance, and thus is a premature optimization. do you happen to have different results?

i do understand this might bring a slight speed improvement after websockets are created, however this comes with the cost of reducing code usability of misultin. moreover, all the rest of misultin should be fully switched to binary too, since i do not like to have two different programming styles in the same library: here we would need to use binary for websockets, and lists/io_lists for the other http functionalities.

do you happen to have different considerations which i may have missed, test results, or anything else? let's discuss about it :)

r.

@cstar
cstar commented Sep 17, 2010

Hi Roberto,

I understand your points very well. I wrote the code this way because my application produces binaries, et sends binaries over the wire. So it made sense for me.
Also binaries are better memory-wise than speed-wise compared to lists, so in a high traffic environment you might get more connections on the same memory footprint. I don't have data backing that up though.

Finally, with the upcoming draft-hixie-01 which changes totally the framing protocol, it will be easy – from my past experience to do that in binaries — on a less professional standpoint, I like binaries a lot ;)

So it's up to you, I understand both sides of the discussion !

In any case, thanks for the misultin websocket code, it was immensely useful.

@ostinelli
Owner

hi eric,

good point about memory usage, i would definitely be interested in seeing data on this - maybe we should dig more? i like binaries a lot as well, small, fast and efficient. i tend to develop bad allergies when i see things such as xml. :)

i'd rather stick to lists right now, but your points are well-taken, and i can only thank you for this. we'll see how it all evolves, too many weird 'reinvent-the-wheel' protocol drafts in websockets, imho.

again, thank you, cheers,

r.

@cstar
cstar commented Sep 27, 2010

Regarding performance, I hope I can get Tsung to support websockets and run all the tests we need.

@ostinelli
Owner

well, you are in the right place with the right tools :D

@cstar
cstar commented Sep 28, 2010

That's part of the plan ;)

@ostinelli
Owner

closed.

@ostinelli ostinelli closed this Mar 22, 2011
@ostinelli
Owner

currently added in 0.8-dev. thank you :)

r.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment