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

simplify RecordId move assignment operator

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v7.2
    • 105
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            colin.stolley@mongodb.com Colin Stolley
            Reporter:
            colin.stolley@mongodb.com Colin Stolley
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: