Another thing to check is the time between the DOMContentLoaded event and the page OnLoad event. The former occurs when the page DOM structure has been loaded by the browser, but no external entities has been loaded, and the second after the resources have been loaded and any JavaScript has been executed.
You can use Firebug on Firefox or Safari 4 to view the network load and how long each took to load. Firebug will show you all the response headers sent and received so that you can see which ones had the "If-Modified-Since" header sent by the browser and which ones received back a content not modified (304 code) to let you know that the CSS, JS or image file was successfully cached. With the cook menu, there could be a large delay in JavaScript especially on older browsers or IE if that code does too much JavaScript initialization. You can try to set the rendered flag to false on certain components with JavaScript to also try to discover the large parts of delay. Another common JSF usage problem is to tie EL expressions to code that does slow work. For example, tying the value attribute on a table component to a getter that performs a database query. JSF re-evaluates EL expressions quite often on components. A good strategy is to load all the resources for a page at the start of the request (you can use a PhaseListener attached to the UIViewRoot to do this cleanly) to ensure that when the EL is invoked, it is a simple return of a loaded value. Hope that helps, Andrew On Fri, Jul 17, 2009 at 4:05 AM, Madhav Bhargava<[email protected]> wrote: > Shashi wrote: > >>Hi All - We have built a J2EE application with JSF (MyFaces, Ajax4JSF) >> ,Spring and IBatis. What we find is, each of the screen takes lot of time to >> >load. We find no performance issue with Spring or Ibatis (after verifying >> via JProfiler). Jprofiler shows the JVM memory is occupied b JSF objects. I >> >found that the screen loading is taking time for two reasons. >>1.The JSF screens (which has cook menu) take time to load. >>2.The overall screen painting in the browser takes time to load. >>Our JSF screens are not too complicated and even the simplest screen takes >> time to load. Note that each of the screens always loads JSCookMenu. We >> >visited apache site for tuning JSF. As per their suggestion we did the >> following >>1. We set the State saving mechanism as server side. >>2. Serialization of session objects was set to false. >>3. Compression of objects was set to false. >>4. Streaming Add Resource and t:documentHead were added. >>But none of these improved the performance. >>The overall screen takes time and I'm wondering if we should do effective >> caching of images,CSS and js files. I visited plenty of websites and tried >> to >move all these client specific files under the <head> tag, loaded the >> images via CSS but nothing helps. We have high capacity machines and I dont >> >think desktop config is playing a role. >>We thought the problem could be bcos of network traffic or slow performance >> of underlying platform websphere server. We checked other application >> >running in the same envrironment and they are extremely fast. The only >> difference b/n our application and the other is JSF. >>I'm short of solutions. Any valuable input will be greatly appreciated. > > > > You might want to check on the following: > > 1. Utilize HttpAnalyzer or any other similar tool to check what is the > response received for every action. Since you have used Ajax in your page > you need to check the response that you are getting back on each ajax call > and whether it is only what should be returned. > > 2. There are some optimizations that are listed on Ajax4Jsf site which > in past has proven to be the guilty party for performance related issues. > > 3. Check what is the size of the response. If the page is too large > then you can consider introducing a gzipfilter to compress the response and > thereby reducing the network bandwidth usage. > > 4. Check if objects are not getting released. Some of the Ajax4Jsf > components like a4j:keepAlive keep the objects in memory for longer period > than expected. > > 5. Also checked if there are too many session scoped beans and thereby > slowly adding to memory usage and eventually affecting everything. > > 6. There are other parameters in myfaces configuration like number of > views in session. Try changing that as well. > > 7. Check if the page is not heavy with different types of content > (images, audio/video etc..). Go for incremental loading. > > > > Thanks, > > Madhav

