Check `@synchronized` usages
@synchronized is the most heavyweight synchronization mechanism of those available, and we use it in 166 places. Try running our tests through Instruments to see what kind of performance penalty we're incurring by using it and if we deem it necessary in any situation, consider using NSLock or pthread_mutex (which could be used via C++'s std::mutex wrapper, which provides the convenient std::lock_guard).
Things to keep in mind when removing @synchronized:
- it sets up an implicit recursive lock; if we need recursion, we'd have to use
NSRecursiveLockorstd::recursive_mutex - it sets up an implicit exception handler; if we rely on this mechanism, we'd have to hand code it ourself
Based on your description, I believe that even though '@syncronized' is the heaviest, it's also the simplest to use. Is that right?
Maybe we should only consider updating those places that are called multiple times per second.