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

WriteBatchExecutor should re-use an UpdateDriver across all updates

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code, Performance
    • None
    • Fully Compatible

    Description

      In the current implementation of WriteBatchExecutor::execUpdate a new UpdateDriver object is implicitly created (under the write lock) for each update in the batch. Constructing an UpdateDriver is somewhat expensive.

      However, an UpdateDriver object can be re-used, so it would be somewhat better if a single UpdateDriver object was created, than reset to handle each individual update operation in the batch. This would amortize the cost of UpdateDriver construction across all of the updates in the batch.

      This would also have the nice side effect of hoisting UpdateDriver construction out of the write lock, as was done in the old update path.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: