On 29/01/2013 20:04, Michael Roberts wrote:
> I'm seeing some differences in the latency of making a post request via
> jQuery versus sending a websockets message.  It maybe that this is overhead
> in my application caused by processing the json I am sending in the
> message, but I find this hard to believe.  I imagined that web socket
> connection should be faster than REST due to it not creating and destroying
> the socket, however this does not seem to be the case.  Is there a reason
> why websockets should be slower?
> 
> I thing I can code up a small test case to illustrate this if this is
> something people are interested in ..

Tomcat version?
Connector?
How much difference?

REST can (and should for performance) use HTTP keep-alive.

There is some overhead in upgrading an HTTP connection to use WebSocket
so for a single request I'd expect the REST request to be faster. Once
both connections are established, WebSocket should be faster (note that
binary messages will be faster than text ones).

If you have a test case that demonstrates this with established
connections I'd certainly be interested.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to