[SERVER-7053] Performance: LockState::isLocked() should be optimized Created: 17/Sep/12 Updated: 06/Dec/22 Resolved: 28/Jul/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code, Performance |
| Affects Version/s: | 2.2.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Tad Marshall | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Sharding
|
| Participants: |
| Description |
|
The LockState::isLocked() function beginning on line 59 in src/mongo/db/lockstate.cpp is a low-level routine that is called heavily. It should be modified to be less expensive. It is generally called with a database name (not a full database.collection name) but it always makes a local copy of the portion that appears before the first period, which is usually the full string. If there are cases where a full namespace name is used, that should be a different version of this routine. If this routine is only called with database names, the string copy should be removed. |
| Comments |
| Comment by Andy Schwerin [ 28/Jul/16 ] |
|
This code went away during 3.0 development when we rewrote the lock manager. |