• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

JSF Performance vs. JSP or Struts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anyone out there done a performance comparison of JSF with alternative technologies?

I'm currently working a production JSF application and I'm running into many barriers when I try to design the UI for high performance. From what I can see in the JSF specification and the MyFaces source code there are a number of performance problems that are built into JSF.

I'm also getting a cavalier attitude from the JSF designers and implementors. For example, check Craig McClanahan's post here: http://forum.java.sun.com/thread.jspa?threadID=545810&messageID=2686286
and Manfred Geiler's comments here: http://www.jsfcentral.com/articles/geiler-04-04.html

Has anyone out there run into performance problems with JSF and overcome them?
 
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well actually, Craig's comment seems pretty civil - and accurate - to me. But I often run into stuff where people try and do exactly what he's counselling against (listing thousands of table rows on a single webpage, so I've seen what he's warning against, and not just in JSF.

I've not yet attempted anything mega-demanding in JSF, so I'm afraid I can't help there. In theory, the JSF lifecycle is complex enough to be costly. However I've spent a lot of my career in performance tuning, and learned that optimizing based on theory can be worse than useless.

Do remember, however, that JSF isn't an either/or proposition. You can mix JSF, Struts, raw JSPs and even FORTRAN CGIs into a webapp if that's what gives you the best balance between performance and utility.
 
John Aronson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

I've gotta clear up something in the last posting. One of the meanings of cavalier is "nonchalant" . That is what I was trying to convey. I didn't mean to imply anyone was being rude. Basically, I think the whole topic of JSF performance is being ignored my the JSF community.

I grabbed the attachments from the original performance bug https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=3 and ran some JMeter tests against the "JSP only" and the JSF versions.

The pages are really simple, the JSP version outputs a page which is visually identical to the JSF page. The table in question had 10 columns and 50 - 200 rows. Not a huge amount of data. I used MyFaces 1.1.3 as the JSF implementation and ran the test in JBoss 4.0.4 GA running on JDK 1.4.2.

Here's the results:

This data confirms the discussion in the sun forum. The JSF version started out nearly three times slower than the JSP page. The relative performance of the JSF version degraded to nearly four times slower as table rows were added.

So if you are thinking about adopting JSF you should be aware of the performance hit and make sure that you can architect around the problem or get the performance benchmarks adjusted. Perceived performance is important in real life projects so it's more than a theoretical problem.

I'd also like to know if anybody has ideas or code samples that make JSF perform better?

John Aronson
[ July 08, 2006: Message edited by: John Aronson ]
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I take "cavalier" as "nonchalant with a side order of dismissive contempt", but that's just because for me the term brings me a mental image of an aristocrat riding amonsts the peasants without too much regard for whether they got out of the way in time.

Nice stats. Thanks for publishing them.

FWIW, I think of JSF as a way of quickly getting a web UI up. There's 2 times when I'd look more closely: 1) The page always comes up unacceptably slow.
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I take "cavalier" as "nonchalant with a side order of dismissive contempt", but that's just because for me the term brings me a mental image of an aristocrat riding amonsts the peasants without too much regard for whether they got out of the way in time.

Nice stats. Thanks for publishing them.

FWIW, I think of JSF as a way of quickly getting a web UI up. There's 2 times when I'd look more closely: 1) The page always comes up unacceptably slow. 2) There's so many hits on the page that the cumulative resource consumption is too high. Fortunately, since JSF isn't an either/or proposition, that I can tune the pages I need to - including switching all the way down to CGI, if necessary - while keeping the convenience of maintaining the less-demanding pages in JSF.

I prefer to limit rows/page to no more than 25 or 30 myself in any event. Studies have shown that when the page gets too long, you tend to lost the user, not just performance.

Some additional measurements that would be interesting to see would include backend time (including time spent getting stuff from the database) and a comparison against Struts timings.
 
Tim Holloway
Saloon Keeper
Posts: 24499
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I take "cavalier" as "nonchalant with a side order of dismissive contempt", but that's just because for me the term brings me a mental image of an aristocrat riding amonsts the peasants without too much regard for whether they got out of the way in time.

Nice stats. Thanks for publishing them.

FWIW, I think of JSF as a way of quickly getting a web UI up. There's 2 times when I'd look more closely: 1) The page always comes up unacceptably slow. 2) There's so many hits on the page that the cumulative resource consumption is too high. Fortunately, since JSF isn't an either/or proposition, that I can tune the pages I need to - including switching all the way down to CGI, if necessary - while keeping the convenience of maintaining the less-demanding pages in JSF.

I prefer to limit rows/page to no more than 25 or 30 myself in any event. Studies have shown that when the page gets too long, you tend to lost the user, not just performance.

Some additional measurements that would be interesting to see would include backend time (including time spent getting stuff from the database) and a comparison against Struts timings.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic