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.
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.