Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4703

CXF loading performance

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.5.8, 2.6.5, 2.7.2
    • Bus
    • CXF with Spring on Tomcat server

    • Novice

    Description

      Context : A lot of beans managed by Spring (more than 2500 beans) and about 120 endpoints managed by CXF

      The loading time of the 120 web services is approximately 4 minutes, too long for me !!

      I identified an area for improvement :

      • CXFBusImpl

      Slowness comes from getExtension(Class<T> extensionType) method
      => loc.getBeansOfType(ExtensionType);

      Here, Spring is looking for beans of a Class in his big context...
      Great, but if no beans are found, the next time this method is called with the same Class, this method is looking again in Spring beans (by getBeansOfType) !!!

      it can be easily improved by adding an emptyBeanExtensions Set which goal is to identify wich Class has no Spring beans.

      Exemple (I saved more than 1 minute loading time with this code):

      public final <T> T getExtension(Class<T> extensionType)
      {
      Object obj = extensions.get(extensionType);
      if (obj == null && !emptyExtensions.contains(extensionType))
      {
      ConfiguredBeanLocator loc = (ConfiguredBeanLocator) extensions.get(ConfiguredBeanLocator.class);
      if (loc == null)

      { loc = createConfiguredBeanLocator(); }

      if (loc != null)
      {
      //force loading
      Collection<?> objs = loc.getBeansOfType(extensionType);
      if (objs != null)
      {
      if (objs.isEmpty())

      { emptyExtensions.add(extensionType); }

      else
      {
      for (Object o : objs)

      { extensions.put(extensionType, o); }

      obj = extensions.get(extensionType);
      }
      }
      }
      }
      if (null != obj)

      { return extensionType.cast(obj); }

      return null;
      }

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            echaplet Eric Chaplet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified