Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2344

Performance improvement: more efficient AnnotProxyFieldValueFactory cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.3, 1.5-M1
    • wicket-spring
    • None

    Description

      AnnotProxyFieldValueFactory holds a cache of proxies for singleton beans. The cache is checked like this:

      // only check the cache if the bean is a singleton
      if (locator.isSingletonBean() && cache.containsKey(locator))

      { return cache.get(locator); }

      However, when the bean is referenced by type rather than by name (the default and common case), 'locator.isSingletonBean()' is a quite expensive operation, because it looks up the bean name by type (it indirectly calls BeanFactoryUtils.beanNamesForTypeIncludingAncestors()).

      I think the call to locator.isSingletonBean() should either be omitted entirely (the cache only contains singleton proxies anyway), or omitted when annot.name() is blank.

      Attachments

        1. profile.JPG
          263 kB
          Ricardo Mayerhofer
        2. SpringBeanLocator.java
          7 kB
          Ricardo Mayerhofer

        Activity

          People

            jdonnerstag Juegen Donnerstag
            raboof Arnout Engelen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: