-
Type: Task
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Replication
Currently we have the bulkWrite operation take in an ops array of the form array<variant<InsertOp, UpdateOp, DeleteOp>>. Internally (i.e. within the server code, from the parsing step onwards), we represent this as a std::vector<stdx::variant<BulkWriteInsertOp, ...>>.
But there isn't any need to do this internally. For example, internally we can maintain three different vectors - one for each type of operation - and during parsing we can append to the correct vector based on the type of operation and have some bookkeeping through indexes.
Likewise, during parsing, we can add to a vector of common fields (like nsInfo index) so that for any operation at some index, we just need to access the vector of common fields and we don't have to call visit() on a variant.
This should bring down overall bulkWrite execution time down by at least 1%.