Improve Performance of Debug Native Object tracking #433
Labels
feature-request
A feature should be added or improved.
needs-discussion
This issue/PR requires more discussion with community.
p3
This is a minor priority issue
In a previous Pull Request a change was made to replace the backing native resource object map in debug mode from a
ConcurrentHashMap
to aHashMap
that used thesynchronized
keyword on the class name around all accesses.While this implementation is also correct, it has slower performance than continuing to use
ConcurrentHashMap
when in debug mode. Synchronization will lock the entire HashMap any time any thread is adding or removing any time from the Map, and will cause contention issues if multiple threads are making reads/writes simultaneously. Whereas ConcurrentHashMap only locks a small inner subset of the backing Map during reads/writes, and makes it much less likely that two threads will create contention issues if both are making modifications simultaneously.For more info on this, see:
The text was updated successfully, but these errors were encountered: