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

More move optimizations for Document/Value

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.0.0-rc0
    • Querying
    • Fully Compatible
    • Query Execution 2021-04-19, Query Execution 2021-05-03, Query Execution 2021-05-17
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: