XStream
  1. XStream
  2. XSTR-725

processAnnotations performance improvement

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.5
    • Component/s: Annotations
    • Labels:
      None

      Description

      AnnotationMapper.processAnnotations is really hot performance-wise in multi-threaded applications (see https://issues.jenkins-ci.org/browse/JENKINS-13154 for more details.)

      This is because every time anything happens, the processAnnotations method is called and it needs to obtain a lock on annotatedTypes. Simply making the annotatedTypes field concurrency-safe doesn't work, because the processTypes methods adds a class to annotatedTypes before it processes its fields.

      In this patch, we introduce another field that keeps track of classes that were already analyzed. This class is concurrency-safe, resulting in a substantial boost in multi-threaded applications.

      1. b.diff
        3 kB
        Kohsuke Kawaguchi
      2. XSTR-725.diff
        5 kB
        Kohsuke Kawaguchi

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Kohsuke Kawaguchi
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: