Open TheChifer opened 10 years ago
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.
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://
Please let em know if there is anyway I can help
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.
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'.