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

More move optimizations for Document/Value

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • Query Execution 2021-04-19, Query Execution 2021-05-03, Query Execution 2021-05-17
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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&)

            Assignee:
            denis.grebennicov@mongodb.com Denis Grebennicov
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: