[@All] Mojarra Important Perfomance Problems

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

10 Mar 2012, 15:43

Thomas, are you the author of JSF Stateless project? The author of the arcticle is Rudi Simic;

http://industrieit.com/blog/2011/11/sta ... -overhead/

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

10 Mar 2012, 16:09

No, but the stateless Extensions is only for Mojarra. I created an project, out of this original, with support for mojarra and myfaces :)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

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

10 Mar 2012, 16:10

Great! Thanks.

KingdomHeart
Posts: 280
Joined: 25 Jun 2010, 01:18

12 Mar 2012, 23:01

Hi Thomas, when you said
I think it will not be accepted. The code seems to be inefficient - i didn't check this with a profiler. Also the improvement is much lesser then with mojarra.
Do you mean the code from the original developer is inefficient?

Mojarra 2.1.10, Glassfish 3.1, Tomcat 7, Primeface 3.3.1
IE 6-8, FireFox 10-13
MAC OSX Lion, Windows XP, 7

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

12 Mar 2012, 23:08

Hi,

here is the mailing list entry:

http://comments.gmane.org/gmane.comp.ja ... evel/54352
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

membersound
Posts: 74
Joined: 10 Feb 2012, 16:48

12 Mar 2012, 23:42

optimus.prime wrote:Out of curiosity I've tested the sample page at;

http://java.net/jira/browse/JAVASERVERFACES-2334

Mojarra ajax results averaged 1000ms and MyFaces ajax results averaged 50ms so difference is huge. Difference ratio also applies to non-ajax requests.

So the topic should be Mojarra Performance Problems, there is an obvious bottleneck in mojarra code.

Can someone instruct me in how to measure my app?
I too have those performance problems, and tried for days to "optimize" my app without success. now, switched just to myfaces, it runs VERY much better.
How do you guys measure this?
PF 3.2, JBoss AS 7, Seam 3, Eclipse 3.7, JEE6

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

13 Mar 2012, 00:16

Very interesting topic. I wonder if I should consider MyFaces over Mojarra.

@membersound, I saw the following mentioned at the URL that you just referenced in your post/response. You might search google for DynaTrace.
adrian_e added a comment - 09/Mar/12 04:04 PM

I would like to add one additional data point. I also tested the example code with DynaTrace (Free AJAX Edition) - it's a free product that is basically FireBug on steroids. You can drill down to the nth degree to see where the bottlenecks are.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

nicolasr
Posts: 32
Joined: 08 Dec 2010, 00:26
Location: France
Contact:

13 Mar 2012, 01:49

Hello,

I noticed that my pages were slow to load too (ajax as well). I run jprofiler and realized most of the CPU was spent in PrimeResourceHandler (which is just a wrapper).
I also noticed that this was mainly due to the few composite components my page is using.

Do you use composite component?

In my case, the patch below enabled me to really boost my performances (code is self explanatory).
make sure you declare it in your faces-config.xml as this:

Code: Select all

<application>
        <resource-handler>yourpackage....PrimeResourceHandlerWithCache</resource-handler>

Code: Select all


import java.util.HashMap;
import java.util.Map;

import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;

import org.primefaces.application.PrimeResourceHandler;

/**
 * This class to circumvent performance limitations observed when using composite component.
 * Indeed, createResource is invoked over and over and consumes a lot of cpu.
 */
public class PrimeResourceHandlerWithCache extends PrimeResourceHandler {

    private Map<String, Resource> resCache = new HashMap<String, Resource>();

    public PrimeResourceHandlerWithCache(ResourceHandler wrapped) {
        super(wrapped);
    }

    @Override
    public Resource createResource(String resourceName, String libraryName) {
        String key = resourceName + "__" + libraryName;
        Resource resource = resCache.get(key);

        if (resource == null) {
            resource = super.createResource(resourceName, libraryName);
            resCache.put(key, resource);
        }
        return resource;
    }
}

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

13 Mar 2012, 09:36

Please file an issue and we will look about create resource.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

13 Mar 2012, 10:14

Regarding to Stateless JSF and performance. Thomas made a comprehensive comparison between Stateful and Stateless JSF, Mojarra and MyFaces, with less and many components on a page. Perhaps he can share this statistic here.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Locked

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 76 guests