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

Use StringSet instead of std::set in getModifiedPaths

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Optimization
    • Fully Compatible
    • QO 2023-07-10, QO 2023-07-24

      If we change `std::set<std::string> paths` () to `StringSet paths`, there are a couple benefits:

      • It uses a hash table instead of a tree.
      • It supports queries like `.count(StringData)`, whereas std::set<std::string> only supports `.count(std::string const&)`, which can require making a copy if you only have a StringData.

      However this assumes we don't care about the order of elements in this set. It looks like we are iterating over this set in a few places, which may or may not mean the order matters. For example if we only union/intersect this with other sets, and check membership, then order doesn't matter.

      Whoever takes this will need to check whether the order matters or not.

            Assignee:
            matt.olma@mongodb.com Matt Olma
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: