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

Avoid dynamic_cast in $not serialization

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2023-06-26

      When looking at the performance profile for our new $queryStats workload, I noticed a lot of time spent in __dynamic_cast when computing the shape of {$exists: false} queries which translate into {$not: {$exists: true}}. It was this line, which doesn't seem to need to use dynamic_cast and can use `matchType()` to figure it out instead.

      I didn't see any other obvious usages of dynamic_cast in src/mongo/db/matcher's serialization functions.

        1. baseline.svg
          960 kB
        2. static_cast_v1.svg
          976 kB

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: