Primefaces performance

UI Components for JSF
Post Reply
egbokul
Posts: 30
Joined: 11 May 2010, 15:39

25 Jun 2010, 13:34

As part of our "risk reduction" project phase I've started to do some performance tests for JSF and Primefaces (2.0.2).
I've created a simple page which lists users (176 at the moment) and their attributes in a table. The call goes through an EJB, and ends in a MySQL query.
First, I implemented this in a servlet, to serve as a baseline. There is hardly anything that's faster than out.println()'s.
As a poor man's tool I used Firebug for preliminary performance testing (good enough to see the tendencies), but I will do a proper round of The Grinder later.

Here is a typical servlet result:

Image

I then measured the naive and native JSF (Mojarra 2.0.2) h:dataTable implementation:

Image

I also tried setting the javax.faces.PROJECT_STAGE option to Production, but it did not seem to have much effect in this case (the difference is too small):

Image

So far so good. JSF does alright.

Enter Primefaces!
p:dataTable instead of h:dataTable, and p:columns respectively. Here is the result:

Image

Again, setting project stage to production did not help:

Image

Well... this is bad. What I don't get is why the .js and .css files are not cached (see active/inactive.png, which I added).
But, even worse is the time between the .js files and sprite.png (I guess we are waiting for javascript code to execute here).

So: it takes a relatively small datatable 4 times longer to load in Primefaces than the Mojarra table. I understand that Primefaces adds a lot of things, but still...
Maybe there's something that I'm missing here? Any tips for performance improvements?

I'm also interested in ideas for other ways of measuring (and comparing) performance of JSF/Primefaces in general.
I'd like to show that it's not that much worse than JSPs/Servlets in general uses (maybe I'll try to also measure partial page refresh and ajax calls).

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Jun 2010, 16:59

Well resources are cached, that's for sure, Resource Servlet adds appropriate cache headers, just double checked with firebug and online showcase. So they will be loaded only once per client.

Also css and js resources are compressed and minimized. If you check them you'll see that they are one line files.

Complex components or complex pages might add more resources, for datatable in 2.1.1 it will be reimplemented so at most there will be 2 js and one css as we'll remove yui dependencies.

For ajax performance please see;

http://cagataycivici.wordpress.com/2009 ... libraries/

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests