[CDRIVER-1331] Avoid realloc in bulk execution Created: 16/Jun/16  Updated: 10/Aug/16  Resolved: 05/Jul/16

Status: Closed
Project: C Driver
Component/s: Bulk API, libmongoc, Performance
Affects Version/s: None
Fix Version/s: 1.4.0

Type: Improvement Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Ian Boros
Resolution: Done Votes: 0
Labels: intern2016
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

_mongoc_write_command splits a stream of documents (all inserts, all updates, or all deletes) to the server 16 mb at a time. Between each 16 mb batch it destroys the command document cmd and reinitializes it. This wastes time in malloc. Just bson_reinit it after the first batch, and bson_destroy only at the end.



 Comments   
Comment by Githook User [ 05/Jul/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #343 from puppyofkosh/CDRIVER-1331

CDRIVER-1331 minor optimization to write_command
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/dfbd3c21bb4f6303cf5e9daa48d520602962012e

Comment by Githook User [ 05/Jul/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #343 from puppyofkosh/CDRIVER-1331

CDRIVER-1331 minor optimization to write_command
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/dfbd3c21bb4f6303cf5e9daa48d520602962012e

Comment by Githook User [ 05/Jul/16 ]

Author:

{u'name': u'ian boros', u'email': u'ian.boros@10gen.com'}

Message: CDRIVER-1331 minor optimization to write_command
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/341c26742bd31adb82ae4189160823f048a51d23

Comment by A. Jesse Jiryu Davis [ 16/Jun/16 ]

Changing my mind, reassigning this from Fiona to Ian.

Comment by A. Jesse Jiryu Davis [ 16/Jun/16 ]

Out of curiosity, try a simple benchmark to see if a very large number of inserts, updates, or deletes is measurably faster.

Generated at Wed Feb 07 21:12:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.