XStream
  1. XStream
  2. XSTR-772

FieldDictionary.buildMap does not scale well in concurrent environments

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.7
    • Fix Version/s: 1.5.0
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      1.8.0_40 for Windows 64 Bit

      Description

      Having many threads concurrently using XStream, we run into scalability issues because of the FieldDictionary. The current implementation still blocks for a cache hit.

      I attached a patch to this issue, using double checked locking and a ConcurrentHashMap to overcome this issue. Using ConcurrentHashMap should be an option for Java 1.5, which is hopefully the target for the current trunk.

      With this patch I also optimized the traversal upwards the type hierarchy. In my opinion traversal could be stopped if a cache entry for a superclass is found.

        Issue Links

          Activity

          Jörg Schaible made changes -
          Field Original Value New Value
          Link This issue is related to XSTR-727 [ XSTR-727 ]

            People

            • Assignee:
              Jörg Schaible
              Reporter:
              Ralf Purnhagen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: