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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.2
    • 1.1
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: