XStream
  1. XStream
  2. XSTR-705

buildMap method of FieldDictionary can be slow in highly concurrent environment - cached element not required to be synched

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.4
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      IBM Java 1.5

      Description

      Pasted my original email I used and the last email from Jörg. Also attached the entire email thread.

      -------------------------
      Hi,
      I am using XStream as part of my application for serializing classes. For one of the use cases, I have to serialize some of the classes implementing Externalizable interface. For my use case I would like to serialize them using native Java serialization. I found a link on the internet, http://old.nabble.com/How-to-remove-Externalizable-Converter-td22747484.html, which helped me address this issue and started using Reflection Converter for my Externalizable classes.

      When testing the application, I am seeing that the application is spending lot of time in converter code during highly concurrent access. I can see that the problem is in the buildMap method of FieldDictionary, http://svn.codehaus.org/xstream/trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java

      I was wondering if there is a better way to address my original issue? Is the performance for Reflection Converter expected to be bad when having highly concurrent environment?

      I really appreciate any help/advice regarding this. Thanks for the help

      Regards
      Shravan (Sean) Pabba

      ----------------------------------------------

      Hi Sean,

      Shravan Kumar wrote:

      > Thanks Joe. Looking forward to a fix.
      >
      > Let me know if you need any additional info.

      You're absolutely right, getting the cached element not required to be
      synched here. Can you open a JIRA issue please, just to track the change?
      It's different from XSTR-635, since at that time the cache was realized with
      a (non-working) WeakHashMap.

      • Jörg
      1. FieldDictionary.java.patch
        11 kB
        Rico Neubauer
      2. Monitor_Usage_Statistics.html
        203 kB
        Rico Neubauer
      3. Using default Java Serialization for Externalizable classes.pdf
        212 kB
        Shravan Pabba

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Shravan Pabba
        • Votes:
          0 Vote for this issue
          Watchers:
          3 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: