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

Elide useless constructor calls for trivially-constructible Decorations

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Service Arch
    • Fully Compatible
    • v7.0
    • Service Arch 2023-05-15, Service Arch 2023-05-29, Service Arch 2023-06-12

      Decoration construction, especially for OperationContext takes a significant amount of time, as there is a very high number of decorations on that type. The cost comes from virtual function dispatch to invoke the constructors. Many of the decorations are trivially constructible and so don't really need any action taken at construction. The task of this ticket is to figure out how to avoid invoking constructor functions that don't need to do any work in order to speed up the construction and destruction of Decorable objects. Presumably this would be similar to SERVER-69383.

      If we cannot do this, we should instead investigate combining related decorations into structures to reduce the number of constructor/destructor actions.

        1. decorations_all.txt
          26 kB
        2. screenshot-1.png
          206 kB

            billy.donahue@mongodb.com Billy Donahue
            schwerin@mongodb.com Andy Schwerin
            0 Vote for this issue
            21 Start watching this issue