[SERVER-81569] Improve performance of NamespaceString Created: 29/Sep/23  Updated: 06/Feb/24

Status: In Code Review
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matthew Russotto Assignee: Didier Nadeau
Resolution: Unresolved Votes: 0
Labels: car-investigation, ntdi_performance, perf-8.0, perf-tiger, perf-tiger-handoff, perf-tiger-poc, perf-tiger-q4
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-84285 Add micro benchmark for NamespaceString Closed
depends on SERVER-84311 Make NamespaceString inherit from Dat... Closed
Related
related to SERVER-81613 Make OpObservers take less time when ... Closed
is related to SERVER-80961 Introduce view types for DatabaseName Closed
Assigned Teams:
Service Arch
Sprint: Service Arch 2023-12-11, Service Arch 2024-01-22, Service Arch 2024-02-05, Service Arch 2024-02-19
Participants:

 Description   

The NamespaceString::ConstantProxy and DatabaseName::ConstantProxy classes currently uses std::call_once to provide access to a NamespaceString object; this is done on every access to the NamespaceString constants. Since std::call_once must do atomic operations, it is fairly expensive, and adds several hundred nanoseconds to opObserver calls just to check that an opObserver shouldn't run.

Additionally, before we had tenantId, getting the database for a NamespaceString was a cheap operation that just got a reference; it now requires a copy. Ideally we would have a DatabaseNameRef class that could be used almost anyplace a DatabaseName is, with DatabaseName reserved for when we need to actually store one.


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