CreamTec
 
  • Home
  • Products
    • AjaxSwing
    • Screenster
  • Services
    • Outsourcing
    • Technology
  • Solutions
    • Conversion to AJAX
    • Quality Assurance
    • AJAX and Rich Internet Applications
    • Portal and Portlet Development
    • Enterprise Architecture
  • About Us
    • About CreamTec
    • Our Customers
    • Management
    • Careers
    • Contact Us
User Guide
  • Home
    Overview
    Screenshots
    Demos
    Download
    Licensing
    Maintenance and Support
    Forums
    Customers
     
  • Documentation
    Setup Guide
    User Guide
    FAQ
    Troubleshooting
    Release History
    Forums
  • Solutions
    Convert Swing to AJAX
    Migrate Swing to HTML
    Deploy Java to cloud
    Deploy Swing without plugin
    Swing to AJAX with GWT
    Java iPad/iPhone/Android
    Convert applet to servlet
    Convert applet to HTML
    WebStart vs Plugin vs AjaxSwing
    Desktop apps to web
    Citrix alternative



Latest News

March 1, 2012
AjaxSwing 3.2.7 is available for download

November 23, 2010
Screenster 1.0 is available for download

February 14, 2010
Symantec OEMs AjaxSwing for its core product line
 
 
Performance and Scalability
Scalability

AjaxSwing is as scalable as your application and the server you are running it on and as fast as your Swing application. It adds a thin layer that replaces the Java graphical environment and emulates the events. In many aspects it can make your application run faster because no drawing, buffering and output to the screen occurs in the emulated mode. There are less events to process and less memory needs to be allocated and garbage collected. Using AjaxSwing dynamic clustering you can combine several virtual clients into the same JVM and specify when to launch more JVMs as the load increases. This model gives a significant performance improvement to each client because shared resources are already loaded and initialized in the JVM. You can specify how many virtual uers should emulated by each JVM, and if there are more users connecting then a JVM can handle, AjaxSwing will launch a new one. JVMs are pooled and are "warmed up" in the background to ensure that a new user session is handled instanteneously. For example, if your client code is fairly thin, you may choose to have up to 100 virtual clients in a JVM. In this case, if your server needs to handle 1000 concurrent users AjaxSwing will use 10 JVM processes. Typically, one running JVM takes 20-100M so the total amount of memory needed to support this traffic would be 200-1000M.

In general, you probably should expect higher resource consumption and slower response time then a pure servlet solution, but lower resource consumption then the Swing application running standalone. Check out this Performance Metrics to see specific performance data and the difference in memory consumption and response time between a regular GUI app, simple servlet and AjaxSwing emulation. Note that the Excel table shows data for one JVM. AjaxSwing applications has been load tested for thousands of concurrent users and the response time has always been comparable to the execution of the native Swing application.

Improving Performance

Performance of AjaxSwing applications is subject to the same constraints as any other web application using HTMl, CSS, JavaScript and XmlHttpRequest. Some tips for better performance are listed below

  • Reduce log level by setting com.creamtec.core.TraceMgr.level to a smaller value in AjaxSwing/conf/TraceMgr.properties
  • Reduce HTML page size by showing less windows and components at a time. Each component show in a Swing window will add to AjaxSwing rendering time, HTML page size, transfer speed and browser parsing.
  • Improve application startup time by initializing all application resources and windows in main() method and using clientAgent.preloadApp=true
  • Use modal dialogs because AjaxSwing only submits updates to the top modal window, ignoring updates to the blocked windows until the modal window is closed
  • Optimize JTabbedPane rendering to suit your application. AjaxSwing can pre-render all tabs when it renders a tabbed pane, avoiding a call to the server when tabs are switched. Or, if JTabbedPane has a change listener, it will only render the selected tab and send a request to the server every time the user switches tabs. Pre-rendering is good for small and simple tabs because it prevents server calls on tab switching, but it can be very costly for complex tabs. This benavior can be controlled by adding a listener to JTabbedPane or through dynamicEvents configuration property
  • Compress images to JPEG to reduce the page load time
  • Use client side validation instead of adding changed listeners to do most of the validations on the client instead of the server
  • Share resources between virtual clients by placing shared classes that do not have global static variables on the application server classpath (for Tomcat that would be shared/lib directory) instead of specifying it on the clientAgent.classPath. Add JDBC connection pooling and other resource pooling for resources that are expensive to obtain
  • Initialize browser cache. When opening a typical webpage the browser spends about 5 times as much loading external resources then it spends on the HTML page itself. This affects the initial load time of the AjaxSwing generated pages, because the pages include external JavaScript files and stylesheets. The key to speed up the loading of the application page is to ensure that the expensive resources are present in the browser cache. AjaxSwing provides init_cache.jsp page that includes expensive AjaxSwing resources and can be customized to include application-specific resources such as images. Typically, application has a "launch" page that provides description and/or instructions to the user, but the browser cache initialization can be done from any page that the user visits prior to AjaxSwing application. The following code can be added to the launch pages to asynchronously load expensive resources into the browser cache:
          <!-- Initialize browser cache for AjaxSwing -->
          <iframe src="http://host/ajaxswing/init_cache.jsp" style="width:0px;height:0px;border:0px;overflow:hidden"/>
       
    where "host" is the host name or address of the server running AjaxSwing application.

 

Copyright © CreamTec, LLC. All rights reserved