Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play2-sockjs performance #12

Open
TheChifer opened this issue Nov 6, 2014 · 3 comments
Open

Play2-sockjs performance #12

TheChifer opened this issue Nov 6, 2014 · 3 comments

Comments

@TheChifer
Copy link

I have just moved from native play websockets to Play2-sockjs.
Firefox & IE seems to be much more stable with sockjs & I get wss over https(something play natively lacks dearly)
However I see a performance decrease around 10-20% across all browsers for both ws & wss traffic(no difference between ws & wss) when compared to native play plain websockets. The test was perfomed using a minimalistic echo server where the client does a sock.send(...) in 'onmessage'.

@fdimuccio
Copy link
Owner

Hi, some overhead must be taken into account when using SockJS. Everytime a message is received or sent from ws (or wss) it must be deserialized or serialized from/to json to be transmitted over a SockJS connection, also for a simple echo server. However when benchmarking make sure to warm up the jvm to let the jit compiler make the right optimizations. I will do some profiling to see if it can be optmized.

@TheChifer
Copy link
Author

Thanks for your response.

I actually did not use SockJS client in my testing, rather used a native browser Websocket with explicit websocket endpoint(wss:////websocket/) created by SockJS server component(play2-SockJS in this case). This is for 2 reasons, first to make sure client test code is uniform across stest & secondly I am interested only in Websockets. In this case I assume no json parsing is done either way?

Please let em know if there is anyway I can help

@fdimuccio
Copy link
Owner

I see, so you are using the raw websocket transport (without SockJS framing), in this case the performance should be very close to the native Play plain websockets (no json parsing is being done).

If you push the code that you used to benchmark I can use it to profile the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants