[SERVER-83282] simplify RecordId move assignment operator Created: 15/Nov/23  Updated: 30/Nov/23  Resolved: 21/Nov/23

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

Type: Task Priority: Major - P3
Reporter: Colin Stolley Assignee: Colin Stolley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.2
Participants:
Linked BF Score: 105

 Description   

The RecordId move assignment operator is a hot path. It uses a swap() function to perform the move: https://github.com/mongodb/mongo/blob/391d97d2e93fc94457c83124b90d6f0c9adee4a3/src/mongo/db/record_id.h#L133-L145
Since the moved-from RecordId object will no longer be in a valid state anyway, we only need to copy the bytes from the moved-from object rather than performing a swap.



 Comments   
Comment by Githook User [ 20/Nov/23 ]

Author:

{'name': 'Colin Stolley', 'email': 'colin.stolley@mongodb.com', 'username': 'ccstolley'}

Message: SERVER-83282: simplify RecordId move assignment
Branch: master
https://github.com/mongodb/mongo/commit/92f0a604e8c552d03471ffa23f98291a9f8907ae

Generated at Thu Feb 08 06:51:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.