[SERVER-80298] Reduce the size of SerializationContext Created: 21/Aug/23  Updated: 25/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Mark Benvenuto Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: ntdi_performance, perf-tiger, perf-tiger-handoff, perf-tiger-non-q4, perf-tiger-project-candidates, perf-tiger-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-80364 Use original request's SerializationC... Closed
Assigned Teams:
Service Arch
Participants:
Story Points: 3

 Description   

Since SerializationContext is in every generated IDL class, reducing its size is benefical

It could easily be collapsed to 4 bytes by just marking the enums as uint8_t.

 

(gdb) ptype /o mongo::SerializationContext
/* offset      |    size */  type = struct mongo::SerializationContext {
                             private:
/*      0      |       4 */    mongo::SerializationContext::Source _source;
/*      4      |       4 */    mongo::SerializationContext::CallerType _callerType;
/*      8      |       4 */    mongo::SerializationContext::Prefix _prefixState;
/*     12      |       1 */    bool _nonPrefixedTenantId;
/* XXX  3-byte padding   */                               /* total size (bytes):   16 */
                             } 


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