Dear quanhm,
It is clear that AJAX applications are based on pure JavaScript technology (together with HTML, DOM, CSS, etc.), which is an interpreted language. So its execution is undoubtedly slower than tradition thick applications (based on Java, .NET or native code). What we see in our experience, is that developers delving into the AJAX world tend at first to do an exact porting of their traditional thick applications to the Web. But AJAX cannot be used for that, because the porting should take into consideration performance. So, after the first attempts, they realize how to change the architecture or the requirements of the application. So, here are some general guidelines (which apply not only to Lightstreamer but to any AJAX and Comet solution):
Visual updates are pretty heavy on the browser, so they should be limited to a reasonable quantity. For this purpose, two techniques can be used:
- Limit the maximum update frequency for each displayed item. Lightstreamer allows to set a maximum frequency, reducing the number of updates. Typical frequencies for browser-based finance applications range from 1 to 3 updates per second. But if you need to have many many concurrent cells in the same page, with a slow hardware or a weak browser, you can choose lower frequencies. You could reach a similar effect by limiting the overall bandwidth of the push session. The conflation capabilities of Lightstreamer allows you to reduce the number of updates without sacrificing data consistency and the degree of real time.
- Limit the number of items displayed on the same page. A design pattern used to limit the number of subscribed items is based on pagination (splitting a long list into different pages), or, better, on grids. A grid is a way to handle a long table of items where only the visible part is actually subscribed, with a great improvement in performance (an example is
http://app.lightstreamer.com/GridDemo/).
Also, the kind of visual effect (highlighting, fading, style change, etc.) and the font used can affect performance in a significant way.
Furthermore, different browsers exhibit pretty different performance. The JS engine of Internet Explorer and Firefox have different efficiencies (with IE7 and FF2 the gap was partially filled, but previously IE was much slower than FF).
We have gone through this optimization process with our customers in the finance industry several times. Starting from a potentially slow front-end and changing its design until a good trade-off between quality of information and performance was reached. Until now, it has always been possible to find a reasonable trade-off.
Cheers,
Alessandro