NodeJS driver bulk write performance issue after upgrade from v3.6.6 to v3.6.8

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.

Is this a known Issue? Should I open a Ticket about this?

Hi, thanks so much for catching this!

It appears that there was an incomplete backport of some bulk operations related code from 4.0 to 3.6 that caused duplicate loops over the result array.

We created the following ticket to track the fix: NODE-3309.

Best regards,
Daria

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.