Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2447

UIComponent.isCompositeComponent() is slow for UIXComponents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0-core
    • 2.1.1-core
    • Components
    • None

    Description

      The JSF implementations hammer on UIComponent.isCompositeComponent () - eg. this is called for each time the pushComponentToEL()/popComponentFromEL() methods are called, which is all of the time.

      isCompositeComponent() performs the following check:

      component.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY);

      Unfortunately, this operation is slower than it should be for Trinidad-based UIXComponents. There reason for this is the non-optimal implementation of containsKey in Trinidad's ValueMap:

      public boolean containsKey(Object key)

      { if (key == null) throw new NullPointerException(); PropertyKey propertyKey = _getPropertyKey(key); if (_bean.keySet().contains(propertyKey)) return true; else return _bean.bindingKeySet().contains(propertyKey); }

      We're creating key sets for both the FacesBean properties and value expressions. Aside from the overhead of creating these key sets, this also means that we bypass optimizations in FlaggedPropertyMap.

      This is showing up as a hot spot in JProfiler, so would like to see this optimized.

      Attachments

        1. trinidad-2447.patch
          3 kB
          Andy Schwartz

        Activity

          People

            andy.schwartz Andy Schwartz
            andy.schwartz Andy Schwartz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: