aspose file tools*
The moose likes JSF and the fly likes Performance issues with JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Performance issues with JSF" Watch "Performance issues with JSF" New topic
Author

Performance issues with JSF

Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

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 Hibernate. 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.
viswanath yadav
Greenhorn

Joined: May 25, 2009
Posts: 15
i think this site will helpful for you


http://www.znetdevelopment.com/blogs/2009/05/01/jsf-suggestion-for-performance-improvement/
viswanath yadav
Greenhorn

Joined: May 25, 2009
Posts: 15

Hi,


Performance measurements have shown that plain server side state
saving (without serialization and without compressing state) comes
with the best values.

Also usage of StreamingAddResource brings about 20% performance
improvements.

Apart from that, using JSP as page description slows down. Facelets
would be the better choice concerning performance.


Thank's
A.Viswanath
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

One of the best things you can do is make sure that the client is caching JSCookMenu. It's of no benefit to you if a massive chunk of (immutable) JavaScript code gets downloaded for each and every page request.

On the other hand, before you blame JSF, make sure that the performance issues are actually due to JSF. Complex JavaScript functionalities such as JSCookMenu can take a considerable amount of time to set up even after JSF has rendered its response and the response has been sent to the client.

Also, do what you can to optimize the menu itself. I have one project where, when incorrectly configured, the server would download 3.5MB of menu data per page. That was very painful. Not only because of the raw time it takes just to transfer that much data, but because once received, the client-side JavaScript code had to assemble it all into menus and the page rendering engine had to lay out the resulting menu display.


Customer surveys are for companies who didn't pay proper attention to begin with.
Shasi Mitra
Ranch Hand

Joined: Nov 27, 2008
Posts: 101

I couldn't understand the statement : "using JSP as page description slows down. Facelets would be the better choice concerning performance". Can anyone explain?
 
jQuery in Action, 2nd edition
 
subject: Performance issues with JSF