[SERVER-59945] RecordId relops should take arguments by const reference Created: 14/Sep/21  Updated: 29/Oct/23  Resolved: 16/Sep/21

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

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2021-09-20
Participants:

 Description   

When RecordId was a trivial wrapper around an int64_t, it made some sense for the free-function relops to be written as taking RecordId by value, but subsequent evolution of RecordId has invalidated that assumption. Notably, the addition of a fixed char array and later a ConstSharedBuffer means that a real copy constructor is getting synthesized and invoked for both arguments to the relops. This is potentially expensive if a RecordId is large and the ConstSharedBuffer is engaged, as it will jiggle the refcount atomic.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 16/Sep/21 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-59945 RecordId relops should take objects by const reference
Branch: master
https://github.com/mongodb/mongo/commit/2d7b970b51dea751dd371838260f591bbf0eb3c0

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