Performance experiment: Use std::unordered_set for usedFieldSet in IDL-generated parsers

XMLWordPrintableJSON

    • Type: Engineering Test
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch 2023-04-17, Service Arch 2023-05-01
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      During the BF-28130 performance investigation, we noticed that the execution of initializeAPIParameters() spends a lot of time maintaining a red-black tree that implements the std::set used by APIParametersFromClient::parseProtected() to check whether the BSON document has any duplicate fields. The parser is generated from IDL, so this happens in every similar parser.

      The goal of this ticket is to do preliminary performance testing to check whether replacing the std::set with std::unordered_set in these parsers would yield any performance improvements.

        1. SERVER-75864 no pre-allocate.csv
          12 kB
        2. SERVER-75864 pre-allocate 4.csv
          12 kB
        3. SERVER-75864 pre-allocate 8.csv
          12 kB

            Assignee:
            Alex Li
            Reporter:
            Vojislav Stojkovic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: