Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80298

Reduce the size of SerializationContext

    • Service Arch
    • Fully Compatible
    • Service Arch 2024-04-01
    • 3

      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 */
                                   } 

            Assignee:
            didier.nadeau@mongodb.com Didier Nadeau
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: