HTTP is a layer built at the TCP level for some that standardize data transfer. Therefore, naturally, using TCP sockets will be less difficult than using HTTP. If performance is the only thing you care about, then simple TCP is the best solution for you.
You might want to consider HTTP because of its ease of use and simplicity, which ultimately reduces development time. If you are doing something that can be used directly by the browser (via an AJAX call), you should use HTTP. In order for a non-modern browser to directly consume TCP connections without HTTP, you will have to use Flash or Silverlight, and this usually happens for rich content such as video and / or audio. However, many modern browsers (starting in 2013) support an API for accessing network, audio and video resources directly through JavaScript. The only thing to consider is the speed of using modern web browsers among your users; see caniuse.com for the latest browser compatibility information.
As for the tests, this is the only thing I have found. See page 5, it has a performance graph. Note that it does not actually compare apples to apples, as it compares the TCP / Binary data parameter with the HTTP / XML data parameter. What begs the question: what data calls your services? binary (video, audio, files) or text (JSON, XML, HTML)?
A general performance-oriented system such as the military or financial sectors is likely to use simple TCP connections. Where, as companies focused on a common network, prefer to use HTTP and use IIS or Apache to host their services.
Darwyn Aug 02 '09 at 1:33 2009-08-02 01:33
source share