JSF Performance: Mojarra improves dramatically with latest release

In our comparative study about the runtime behavior of both JSF implementations we came to the conclusion that Apache MyFaces performs significantly better on large component trees than the reference implementation Oracle Mojarra. The duration Mojarra  took to step through the JSF lifecycle was increased by factors compared to MyFaces, e.g. a view containing 1.000 components took more than 5 times longer to render with Mojarra. This led to the assumption that the overall performance of Mojarra-based JSF applications may improve notably by simply switching the implementation to MyFaces.

However, Mojarra is the default JSF implementation e.g. in JBoss AS, so it is widely used in the industry today. Switching the implementation is not always a desirable solution, so it was just a matter of time until the Mojarra team had to deal with the observed performance degradation . Mojarra 2.1.22 was released on May 8th, and it was announced to contain a fix for https://java.net/jira/browse/JAVASERVERFACES-2494.

So the question is: “How big is the improvement?”. To answer this question we repeated some of the performance measurements with the latest releases of Mojarra and MyFaces and compared them to the results taken earlier.


As you can see, until a total view size of around 1200 components the time taken by Mojarra and MyFaces to complete the JSF Lifecycle is close to identical. Mojarra even gained a small improvement of about 8% until a component tree size of 1.000 components is reached. The dashed red line marks the results taken earlier, clearly showing that Mojarra had issues with larger sized component trees.

This time there are two conclusions to be drawn:

  1. Referred to the size of the component tree, both implementations behave very similar. Developers facing performance issues with large component trees may take other measures to improve their applications performance than to switch the implementation.
  2. An upgrade to the latest Mojarra release is heavily advised due to the dramatic performance improvements.
Views All Time
Views Today
Short URL for this post: http://wp.me/p4nxik-1xY
This entry was posted in Java EE, Java Web Frameworks, Web as a Platform and tagged , , , . Bookmark the permalink.

9 Responses to JSF Performance: Mojarra improves dramatically with latest release

  1. Reblogged this on Yellowfire and commented:
    Füge hier deine Gedanken hinzu… (optional)

  2. sam says:


    Thanks for the note. TechEmpower is doing benchmark test for all frameworks(http://www.techempower.com/benchmarks/#section=data-r5), in that JSF is missing. we have not yet received a Git hub pull request with a JSF implementation of the tests. If you have time to do the implementation yourself, we’d gladly receive a JSF pull request!

    They put this into a Github issue for the time being.


    If plan to consider JSF, try it in following scenario

    A) Plain JSF Test

    1) Mojarra
    2) Myfaces

    B) JSF + Primefaces

    C) JSF + Icefaces

    D) JSF + Richfaces

  3. Thomas Asel Thomas Asel says:

    Unfortunately the tests used in the techempower benchmark are focused on JSON serialization and database access. This focus may be helpful for platform comparison or full-stack frameworks but they are not suited for a comparison of frameworks the are solely focused on MVC. To be more specific, with the given tests the results for setup A) through D) will be identical since not a single JSF/RichFaces/ICEFaces/PrimeFaces Feature will be used.

    The tests are rather suited for a comparison of e.g. vert.x and plain Servlets than for component based MVC frameworks.

  4. Jens Scharnow says:

    thanks for this note and for the initial study.
    Actually I observed in a mojarra based project with a big number of components that performance also depends on the uptime of the application: After several days of usage, pages which run fast after startup of the container start getting slower significantly. Only a container restart helps in this situation.
    My assumption is that mojarra has some kind of internal component dictionary which is not cleanly cleared after sessions terminate. Unfortunately I was not yet able to prove this with a simple example.
    Did you observe a similar behaviour during your tests?

  5. Thomas Asel Thomas Asel says:

    That sounds interesting. I could not observe such behaviour yet. Have you posted this to the Mojarra issue tracker?

  6. Stevanicus says:

    What do the performance stats look like in 2014?

  7. What do the performance stats look like in 2016?

Leave a Reply