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

Optimize doc_diff generation code for modifier style updates to do fewer allocations

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      When doing a modifier-style update ($set, $unset, $inc etc), the query system generates a doc_diff from the modifier tree as it is applying the update. This uses the V2LogBuilder which allocates roughly one node per modification, plus nodes representing sub-objects and arrays.

      We should look into optimizing this, either to avoid the tree allocations completely (perhaps if the update is simple and doesn't touch many overlapping fields), or to make them cheaper.

      This could be done at the same time as SERVER-97094, or independently. This task should be somewhat easier than SERVER-97094, since we have already analyzed the query and understand the shape of the update.

      Before doing this task, we should also construct a test that stresses the diff building code.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: