Addess recent performance regressions in mixed workloads (SERVER-74848)

[SERVER-75116] Avoid building the same ResourceId object over and over Created: 21/Mar/23  Updated: 29/Oct/23  Resolved: 27/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Sub-task Priority: Major - P3
Reporter: Colin Stolley Assignee: Colin Stolley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 24/Mar/23 ]

Author:

{'name': 'Colin Stolley', 'email': 'ccstolley@github.com', 'username': 'ccstolley'}

Message: SERVER-75116: Avoid building the same ResourceId object
Branch: master
https://github.com/mongodb/mongo/commit/6ae2fa20196d35e384607e636c3d051c78a5c76b

Generated at Thu Feb 08 06:29:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.