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

make $pullAll more efficient

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.2.0-rc0
    • 2.1.1
    • None
    • None

    Description

      It appears that the $pullAll operator is implemented inefficiently. The current implementation loops over the target array and for each element, loops over the set of things to pull. So if you are pulling m elements from an array of size n, this takes O(n*m) time. It is possible to do this in O(n+m) by using a hash table to loop once over things to pull, then once over the target array. The difference might be noticeable for large values of m and n.

      Attachments

        Activity

          People

            Unassigned Unassigned
            matulef Kevin Matulef
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: