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

More move optimizations for Document/Value

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc0
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Query Execution 2021-04-19, Query Execution 2021-05-03, Query Execution 2021-05-17
    • Linked BF Score:
      0

      Description

      Document/Value dates from before C++11, so some places where it is using const& would benefit from either a && or by-value overload. Their lack is not intentional, more that it wasn't possible to move at the time they were written. The basic move support was added in SERVER-18520, but more work is needed to take full advantage of it.

      A few notable omissions (very much non-exhaustive):

      • Value::Value(const Document&) and everything it recursively calls. The high call depth probably means it makes sense to use a && overload, since the by-value cost increases with depth even when moving.
      • MutableDocument::addField(StringData, const Value&)

        Attachments

          Activity

            People

            Assignee:
            denis.grebennicov Denis Grebennicov
            Reporter:
            redbeard0531 Mathias Stearn
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: