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

RecordId relops should take arguments by const reference

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Dev Platform 2021-09-20

    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.

      Attachments

        Activity

          People

            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: