Consider replacing ReaderWriterLock with ReaderWriterLockSlim


Has the Unity SDK team experimented with ReaderWriterLockSlim? The reason I bring it up is because when profiling, SendBird sticks out because ReaderWriterLock allocates 100 bytes every frame because of the calls to AcquireReaderLock and ReleaseReaderLock. It must be something to do with Mono because I used MemoryDiagnoser in a BenchmarkDotNet project for net6.0 and netcoreapp3.1, and those calls don’t generate any garbage.

Just checking to see if anyone from the Unity SDK team had a chance to take a look at this thread. Here’s a screenshot from the profiler which occurs every frame: