tag : WebSocket

Is Sending Messages Through WebSockets Slow on Chrome?

It wasn’t long ago that I ran into a strange issue with Chrome. My Jasmine tests were failing because the timeout on the asynchronous actions was too short for Chrome, even though they worked perfectly fine for Firefox. This led to me writing some tests to see if Chrome’s WebSocket implementation was slow which gave some pretty interesting results. I’ve also heard some interesting results from my readers, so I decided to investigate some more.

Are WebSockets Slow on Chrome?

In my last article where I talked about unit testing Socket.IO with Jasmine, there was a point where I mentioned that I needed to use timeouts that were a second and a half when doing the asynchronous connecting and disconnecting from the Socket.IO server. It was working just fine with 750 millisecond timeouts on Firefox, but when I tested it in Chrome, timeouts were being reached and the specs were failing. Let’s see if we can get to the bottom of this and figure out why Chrome failed so hard here.