Performance: Reduced lock contention in BsonSerializer.LookupActualType

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

        1. image-2019-02-21-17-39-35-659.png
          11 kB
          dnickless
        2. image-2019-02-21-17-41-20-757.png
          11 kB
          dnickless

              Assignee:
              James Kovacs
              Reporter:
              Daniel Hegener
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: