MyFaces Core
  1. MyFaces Core
  2. MYFACES-3474

[perf] LifecycleProviderFactory does not cache created Factory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.12, 2.1.6
    • Fix Version/s: 1.2.12, 2.0.13, 2.1.7
    • Component/s: None
    • Labels:
      None

      Description

      It seems that
      org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(FacesContext, ManagedBean) tries to locale implementation of a interface, but the instance found is never stored in application map: see code in org.apache.myfaces.config.annotation.LifecycleProviderFactory.getLifecycleProviderFactory(ExternalContext)

      this lead to Webappclassloader.loadClass invocation, which is sychronized and accesses disk.

      Can significantly affect perfomance of myfaces app with managed-bean in multithreaded environment.

      maybe reason for http://prezi.com/dr3on1qcajzw/www-world-wide-wait-devoxx-edition/ ?

        Activity

        Hide
        Leonardo Uribe added a comment -

        I have to say it: Martin, you have found a very, very, very insteresting thing. I tried it and you are right.

        This few lines has a huge impact on performance. I reviewed all other SPI interfaces and does not have the problem, so it was just this class. Some months ago I detected a problem in this area, but instead check this class I optimize LifecycleProvider related interfaces, so I skipped this part.

        This finding is just great!.

        I agree maybe this issue has something to do with the slow response time. Thanks a lot for the patch. This is a very valuable contribution.

        Show
        Leonardo Uribe added a comment - I have to say it: Martin, you have found a very, very, very insteresting thing. I tried it and you are right. This few lines has a huge impact on performance. I reviewed all other SPI interfaces and does not have the problem, so it was just this class. Some months ago I detected a problem in this area, but instead check this class I optimize LifecycleProvider related interfaces, so I skipped this part. This finding is just great!. I agree maybe this issue has something to do with the slow response time. Thanks a lot for the patch. This is a very valuable contribution.

          People

          • Assignee:
            Martin Kočí
            Reporter:
            Martin Kočí
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development