Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-272

Reduce lock contention in LookupSerializer (and in serialization config in general)

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2
    • Affects Version/s: 1.1
    • Component/s: None
    • None

      LookupSerializer is called millions of times under heavy load. Currently it uses an exclusive lock to provide thread safety. Since after a short initialization period the access pattern becomes almost exclusively read-only it would be very beneficial to switch from an exclusive lock to a shared ReaderWriterLockSlim which would allow parallel readers.

      This is motivated by an actual test scenario that showed lock contention really was happening.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: