Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4186

[perf] concurrency issue in _ComponentAttributesMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.24, 2.1.18, 2.2.12, 2.3.0-beta
    • 2.0.25, 2.1.19, 2.2.13, 2.3.0
    • None
    • None

    Description

      We've hit a performance issue with the property descriptor map in _ComponentAttributesMap. Driving a heavy load to an application, we can see threads spending a lot of time in this area:

      ...
      (entered lock: java/util/Collections$SynchronizedMap@0x000000000000000, entry count:1)
      at javax/faces/component/_ComponentAttributesMap.getPropertyDescriptor(_ComponentAttributesMap.java:394(Compiled Code))
      at javax/faces/component/_ComponentAttributesMap.containsKey(_ComponentAttributesMap.java:165(Compiled Code))
      at javax/faces/component/UIComponent.isCompositeComponent(UIComponent.java:239(Compiled Code))
      ...

      In this case, replacing the HashMap used by _propertyDescriptorMap with a ConcurrentHashMap gives us much better performance. Since we can use a ConcurrentHashMap here, there shouldn't be any performance hit in the normal case.

      Related: https://issues.apache.org/jira/browse/MYFACES-3216

      Attachments

        1. MYFACES-4186.patch
          1 kB
          Bill Lucy

        Activity

          People

            wtlucy Bill Lucy
            wtlucy Bill Lucy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: