[SERVER-75529] Revisit memory layout for TenantId, DatabaseName, and NamespaceString to address performance regression Created: 31/Mar/23 Updated: 29/Oct/23 Resolved: 26/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Max Hirschhorn | Assignee: | Matt Broadstone |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v7.0
|
||||||||||||||||||||||||||||||||||||||||
| Sprint: | Server Serverless 2023-04-17, Server Serverless 2023-05-01 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 129 | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
NamespaceString is one of the core datatypes of the system. It is widely used for authorization checks, logging, resource locking, etc. Ongoing changes have led to the NamespaceString class to grow from 40 bytes to 88 bytes and based on this patch build it appears the performance is sensitive to changes only to the size of the data structure (e.g. 8-9% throughput drop for linkbench2). The addition of the DatabaseName class as a member variable to NamespaceString is what accounts for the additional 48 bytes. We should explore different memory layouts for TenantId, DatabaseName, and NamespaceString to have the system be more efficient. |
| Comments |
| Comment by Githook User [ 02/May/23 ] |
|
Author: {'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}Message: (cherry picked from commit 3e76161bc537343aa585b305c068b1910578c07f) |
| Comment by Githook User [ 26/Apr/23 ] |
|
Author: {'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}Message: |
| Comment by Louis Williams [ 31/Mar/23 ] |
|
If it helps, we had similar issues when we increased the size of RecordId. One of the main improvements involved removing any unnecessary copies |