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

Improve AccumulatorTopBottomN() constructor

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • QE 2022-09-19

      There are three opportunities to improve AccumulatorTopBottomN<sense, single>::AccumulatorTopBottomN().

      We can reserve vector elements so that we don't reallocate it as the vector size grows.

      https://github.com/10gen/mongo/blob/master/src/mongo/db/pipeline/accumulator_multi.cpp#L425

      We can move objects in follow two cases.

      https://github.com/10gen/mongo/blob/master/src/mongo/db/pipeline/accumulator_multi.cpp#L437

      https://github.com/10gen/mongo/blob/master/src/mongo/db/pipeline/accumulator_multi.cpp#L442

      Better to save this for new engineers and so added neweng label.

            Assignee:
            ivan.fefer@mongodb.com Ivan Fefer
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: