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

Avoid element-wise iteration and copy when appending to an object in doc_diff::applyDiff

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Execution Team 2021-04-19, Execution Team 2021-05-03

    Description

      The current algorithm iterates over each field in the subdocument and copies it individually when adding a new field. In the timeseries case, where we may have hundreds of fields in each "column", this can be pretty bad quadratic behavior. The goal of this task is not to remove the quadratic behavior, but rather to minimize the coefficient for it by short-cutting: when we know we are just appending a field, we can take advantage of this to do a memcpy on the underlying BSON binary data, and just adjust the length for the subdocument to account for the new element.

      Attachments

        Activity

          People

            dan.larkin-york@mongodb.com Dan Larkin-York
            dan.larkin-york@mongodb.com Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: