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

Performance: Reduced lock contention in BsonSerializer.LookupActualType

    XMLWordPrintableJSON

Details

    Description

      Performance profiling in our multithreaded environment seems to indicate that BsonSerializer.LookupActualType is on the hot path during deserialization. This is caused by the current reader-writer lock implementation. There is, however, an opportunity to reduce lock contention using a non-generic Hashtable which is safe for concurrent reads as per https://docs.microsoft.com/en-us/dotnet/api/system.collections.hashtable?redirectedfrom=MSDN&view=netframework-4.7.2#thread-safety.

      Attachments

        Activity

          People

            james.kovacs@mongodb.com James Kovacs
            daniel.hegener@gmx.net Daniel Hegener
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: