10 Replies Latest reply on May 13, 2013 2:48 PM by ssilvert

    Mojarra very slow page rendering with larger pages

    rkite01

        I pulled some of the following text from a Mojarra bug I submitted August of 2012.  In their latest release the issue has gotten worse. 

       

      Issue I submitted in Mojarra's bug tracking system --> 

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

       

        Obvious that Mojarra has a performance problem that does not scale linearly with page size.  It appears to scale exponentially.  There should be a simple fix but the Mojarra project just keeps kicking the can.  Myfaces is not having the issue and is must faster.  

       

      Translation from German article comparing Mojarra performance to Myfaces  -->   

      http://blog.oio.de/2013/04/08/jsf-comparison-myfaces-vs-mojarra/

       

       

      From my Mojarra bug post -->

      Rendering of JSF pages is very slow and gets slower as the number of components on a page increases.  By debugging Mojarra code I have found that for every "entry" in a page processed the tree is walked from the top node down. It finds the correct positions of the nodes to be modified by walking the tree 100s of times per page load.  Is there a way Hash maps or other data structures could be used to avoid walking the full tree so many times per page load?   We have many pages where just the rendering, Post or AJAX request takes several seconds even if there is no database access.  There is no way to support multiple users when a page load takes 2 or more seconds at 100% CPU utilization.  Rendering of the page should be in fractions of a second and not take longer than database access.   

        • 1. Re: Mojarra very slow page rendering with larger pages
          kidvid

          This is a really seroius issue that's negatively affecting the peformance of some complex pages in our JSF web app. 

           

          Unfortunately, it's making JBoss look bad as well.  It's not easy to explain to management that a framework packaged with a server is something that the people who make the server aren't responsible for.

           

          Is anyone on the JBoss team aware of this problem and/or raised the issue with the Mojarra folks?  We need to put some heat on those guys!

          • 2. Re: Mojarra very slow page rendering with larger pages
            nickarls

            Stuart Douglas will probably write a new JSF implementation once he's done with the web server

             

            But I agree - this is not the first time mojarra has seen performance issue in various areas.

            • 3. Re: Mojarra very slow page rendering with larger pages
              ssilvert

              Adrian Everett wrote:

               

              This is a really seroius issue that's negatively affecting the peformance of some complex pages in our JSF web app. 

               

              Unfortunately, it's making JBoss look bad as well.  It's not easy to explain to management that a framework packaged with a server is something that the people who make the server aren't responsible for.

               

              Is anyone on the JBoss team aware of this problem and/or raised the issue with the Mojarra folks?  We need to put some heat on those guys!

              In AS7, it's now very easy to replace Mojarra with MyFaces.  The MyFaces SPI's are implemented and do ship with AS7. 

               

              As part of the effort to make AS7 JSF-agnostic, I've been hoping that the community could do more of the manner of testing you have done and tell us which implementation is truly better.  But also note that "better" changes over time.  I think if you took a survey a few years ago people would say that the nod goes to Mojarra.  Perhaps today it would go to MyFaces.

               

              We've even toyed with the idea of shipping both implementations.  Perhaps we should revisit that idea.

               

              Stan

              • 4. Re: Mojarra very slow page rendering with larger pages
                kidvid

                Thanks for your input Stan.

                 

                That's great to hear that it's going to be much easier to incorporate MyFaces into AS 7.1 than in AS 7.0.  Packaging both implemenations with a release would definitely be useful and time saving. 

                 

                Would this be the best and most current guide to plugging Myfaces into JBoss AS 7.1?

                 

                https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature#comment-11484

                 

                Regarding the back and forth between Mojarra and MyFaces:

                 

                I suspect that most people don't care one way or another if the latest and greatest version of MyFaces or Mojarra is better than the other by 10 or 15% for a particular task, because in most circumstances that's not enough difference to significanty decrease the responsiveness of a JSF page.

                 

                However, this time I feel that it's a bit different for large pages; the best analogy I can use is that MyFaces is racing along in a Ferrari and Mojarra is putting along in a golf cart.  The reason that some developers, myself included, are making such a big deal over the current advantage that MyFaces has over Mojarra is because the AJAX performance difference for large and complex pages isn't trivial - it's massive; it's the kind of performance difference that an end-user is able to notice and rightfully take issue with.

                 

                Thanks,
                Adrian

                • 5. Re: Mojarra very slow page rendering with larger pages
                  ssilvert

                  Adrian Everett wrote:

                   

                  Thanks for your input Stan.

                   

                  That's great to hear that it's going to be much easier to incorporate MyFaces into AS 7.1 than in AS 7.0.  Packaging both implemenations with a release would definitely be useful and time saving. 

                   

                  Would this be the best and most current guide to plugging Myfaces into JBoss AS 7.1?

                   

                  https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature#comment-11484

                   

                  Yes, that's it.

                   

                  Adrian Everett wrote:

                   

                  Regarding the back and forth between Mojarra and MyFaces:

                   

                  I suspect that most people don't care one way or another if the latest and greatest version of MyFaces or Mojarra is better than the other by 10 or 15% for a particular task, because in most circumstances that's not enough difference to significanty decrease the responsiveness of a JSF page.

                   

                  However, this time I feel that it's a bit different for large pages; the best analogy I can use is that MyFaces is racing along in a Ferrari and Mojarra is putting along in a golf cart.  The reason that some developers, myself included, are making such a big deal over the current advantage that MyFaces has over Mojarra is because the AJAX performance difference for large and complex pages isn't trivial - it's massive; it's the kind of performance difference that an end-user is able to notice and rightfully take issue with.

                   

                  Thanks,
                  Adrian

                  When I say "better" I'm talking about much more than performance.  And of course, "better" might depend on exactly what kind of app you are developing and what you think is important.

                   

                  Right now, Mojarra is "better" than MyFaces when it comes to JSF 2.2.  MyFaces doesn't have a 2.2 release completed yet.

                   

                  I'm hoping that our agnostic stance on JSF will be popular and I'm also hoping that this will be a very easy sell to management.  If you just stick to the JSF spec you should be able to easily test your app against both and then pick the one that is best for your situation.  To me, that seems better than other vendors who lock you into one impl or the other.

                   

                  Stan

                  • 6. Re: Mojarra very slow page rendering with larger pages
                    rkite01

                        Can I do this just by adding modules?   The cli file is for JBoss 7.2 Final which has different paths than 7.1.1.  Also to add to the confusion there is no 7.2 Final release.  If this can not be done with a final release then it is worthless to us.

                     

                        What modules and module paths do I need for JBoss 7.1.1 to use MyFaces? 

                     

                        I am attaching two files that demonstrate the performance issue.

                    • 7. Re: Mojarra very slow page rendering with larger pages
                      kidvid

                      I took a look at your guide Stan, but it doesn't really address JBoss 7.1.1.  Is adding MyFaces to 7.1.1 as a module even possible?

                       

                      Adrian Everett wrote:

                       

                      Thanks for your input Stan.

                       

                      That's great to hear that it's going to be much easier to incorporate MyFaces into AS 7.1 than in AS 7.0.  Packaging both implemenations with a release would definitely be useful and time saving.

                       

                      Would this be the best and most current guide to plugging Myfaces into JBoss AS 7.1?

                       

                      https://community.jboss.org/wiki/DesignOfAS7Multi-JSFFeature#comment-11484

                       

                      Yes, that's it.

                      • 8. Re: Mojarra very slow page rendering with larger pages
                        ssilvert

                        Adrian Everett wrote:

                         

                        I took a look at your guide Stan, but it doesn't really address JBoss 7.1.1.  Is adding MyFaces to 7.1.1 as a module even possible?

                         

                        For all practical purposes, no.  Multi-JSF was added in 7.2.  For earlier 7.x AS versions you are better off using WAR_BUNDLES_JSF_IMPL with MyFaces.

                         

                        Stan

                        • 9. Re: Mojarra very slow page rendering with larger pages
                          rkite01

                              Mojarra fixed their performance problem.  It is implemented in 2.1.22 and 2.2.1 releases. 

                           

                              Retested with Mojarra release 2.1.9, Clock time was 2.84 seconds for Ajax and 3.03 seconds for the post. 

                              With fixed version 2.1.22, Ajax call was under 1/10 second and the page Post was about 1/3 second.

                           

                              2.1.22 api

                              https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-api/

                           

                              2.1.22 impl

                              https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-impl/

                          • 10. Re: Mojarra very slow page rendering with larger pages
                            ssilvert

                            If you don't mind hacking AS7, you can just replace the jars with the latest Mojarra 2.1.x.  Just put the impl jar in modules/com/sun/jsf-impl/main.  Then update modules.xml accordingly.

                             

                            Do the same with the API jar.  It goes in modules/javax/faces/api/main.

                             

                            For Mojarra 2.2.x, you need AS8/WildFly.  The same hack will work.

                             

                            The difference in the jars we ship is that it sometimes includes bug fixes that are critical to AS/WildFly, but aren't yet in the upstream release.  For Mojarra 2.1.22, everything should be up to date.

                             

                            Stan