Richard Searle's Blog

Thoughts about software

Performance feasibility of “Real time” display via comet

Posted by eggsearle on June 4, 2011

Chat and stock tickers are the canonical Comet applications. The latter indicates that web applications might be able to implement “real time” applications that are currently the domain of Swing and SWT applications. For example: process control mimic panels, network status displays, etc.

Lift provides a very easy to use Comet implementation that is particularly well suited to these problem domains. A trivial test of feasibility was created from the Clock example code, modified as follows:

  • two actors per page
  • each actor updating 10 text labels
  • 10 Hz refresh

The test environment is a single dual core 2.8 Ghz processor, running both the Jetty server and the browser.

Chrome javascript console indicates each Comet request has ~ 14ms latency, which is impressive. 

The CPU load is much less impressive: > 50 % of a one core.   This is surprisingly large, but certainly acceptable for a direct replacement of a Swing/SWT application where the machine is dedicated to a single user.  The Jetty server load increases slowly with additional clients, allowing a dozen or so clients to be supported from a single server.  This is more than sufficient for the domains of interest.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: