Investigate apparent regression in classic engine IDHACK
(SERVER-68110)
|
|
| 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: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Sprint: | QE 2023-05-15 | ||||
| Participants: | |||||
| Linked BF Score: | 30 | ||||
| Description |
|
LockStats has a function called reset() which resets its counters to zero. These are all atomic sets, so they're not trivially cheap. LockStats unnecessarily calls reset() in both the constructor and the destructor. These are both called with every OperationContext's lifetime, so it's a pretty hot path. The constructor doesn't need to call reset() because it can construct the atomics with an initial value of 0 instead. Initial values are not set atomically, which makes them cheaper. The destructor doesn't need to call reset() because the object is in the process of being destroyed. This was probably a copy/paste mistake. |
| Comments |
| Comment by Githook User [ 02/Mar/23 ] |
|
Author: {'name': 'Colin Stolley', 'email': 'colin.stolley@mongodb.com', 'username': 'ccstolley'}Message: |