[Libwebsockets] Performance Challenges vs socket.io

Ignas igalvelis at gmail.com
Tue Jun 7 03:35:52 CEST 2016


Hi Guys,
I was really happy being able to compile and get libwebsockets working.
However I am having some challenges with understanding performance of
libwebsockets on windows.I did a bit of a read on the google group, but
seems people are taking about unrelated issues.
In terms of performance. I did a very simple test that goes loads the
html/javascript for client, waits 5 seconds then and pings the server over
websocket and then downloads 30k worth of data from a server over the
websocket. Unfortunately what I am trying to do is latency critical and I
compared to socket.io I can see at least 50+ ms delay. Using wireshark I
have narrowed it down to basically libwebsocket not pushing the frames as
fast. Could anyone take a look at my test code and see if there is anything
I can do to improve it (besides making it more readable of course)?
http://pastebin.com/91Z6zUQj
Considering it is just the "lws_service(context, 0);" line I am not sure if
there is.

I am attaching wireshark captures in case you would like to compare those:
https://www.dropbox.com/sh/ik8txohp9m76948/AADXSJUxvgy6zIwEcmi_3zK1a?dl=0

>From what I can see after the 5 second mark once the protocol has
initialised, the diffence is that libwesockets are using RSL and IPA
protocols compared to socket.io TCP.

Regards,
Ignas
Cell +44 7938015569
---
"A week of coding can spare an hour of thought."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20160607/a621d7d6/attachment.html>


More information about the Libwebsockets mailing list