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

WriteBatchExecutor should re-use an UpdateDriver across all updates

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code, Performance
    • None
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: