-
Type: Sub-task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
The constructor for ResourceId computes the hash of the entity each time. Here, we do this in the hot path over and over for the same Resource:
https://github.com/10gen/mongo/blob/master/src/mongo/db/concurrency/lock_stats.h#L135
This can be moved to a constant and save a lot of needless computation.
xxhash might also speed up ResourceId, but it may not matter enough to bother with it.