Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-3309

Bulk write performance issue due to duplicate getter loops

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.6.9
    • Affects Version/s: 3.6.7, 3.6.8
    • Component/s: None
    • Labels:
    • Not Needed

      Issue originally reported as an upgrade problem from v3.6.6 to v3.6.8 here

      After upgrading the NodeJS driver package from 3.6.6 to 3.6.8 i encountered an unexpected performance issue when trying to insertMany() with 10K documents. I tracked down the issue and it seems that lib/operations/bulk_write.js line 80 in v3.6.8 the culprit. That is the reindexing operation performed on the insertedIds array.

      In 3.6.6 the entire array was created from scratch which isnt possible in 3.6.8 due to restrictions not allowing the override of ‘r.insertedIds’. On my machine 3.6.6 is approximately 100x faster than 3.6.8 on the mentioned set with 10000 documents.

      The cause of the problem was an incomplete backport of the bulk getters from 4.0: the now duplicate loops in operations/bulk_write.js were not removed when the getters were introduced.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: