[SERVER-55058] More move optimizations for Document/Value Created: 09/Mar/21  Updated: 29/Oct/23  Resolved: 04/May/21

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Denis Grebennicov
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-04-19, Query Execution 2021-05-03, Query Execution 2021-05-17
Participants:
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&)


 Comments   
Comment by Githook User [ 04/May/21 ]

Author:

{'name': 'Denis Grebennicov', 'email': 'denis.grebennicov@Deniss-MacBook-Pro-2.local'}

Message: SERVER-55058 More move optimizations for Document/Value
Branch: master
https://github.com/mongodb/mongo/commit/3d62d53403edf06f3eaee84913dd6571a9af1132

Generated at Thu Feb 08 05:35:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.