Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-509

ClassMap synchronization is a major source of contention

      Synchronization in the ClassMap class is the number one performance issue in our performance tests - specifically, in BSON.applyDecodingHooks(Object)

      The problem is that this lock is acquired repeatedly by any thread that is decoding elements, leading to a comb pattern of acquisitions and almost certainly not only guaranteeing contention but a moiré pattern of it leading to heavy switching overhead.

      A better strategy would be a CopyOnWriteMap. We have an Apache licensed CopyOnWriteMap impl if required.

            Assignee:
            brendan Brendan W. McAdams
            Reporter:
            jedws Jed Wesley-Smith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: