[CSHARP-1308] Difference in bulk() insert performance between javascript and C# Created: 11/Jun/15 Updated: 21/Jun/15 Resolved: 21/Jun/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dmitry Agranat | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 2012 R2, 64bit. MongoDB 3.0.3, WT, zlib, 1GB Cache size |
||
| Issue Links: |
|
||||
| Description |
|
Hi, Issue summary.Originally, customer has reported degradation over time when inserting with single-thread into random fields covered by indexes. This is expected and was easily reproduced. However, when running Javascript with db.collection.initializeUnorderedBulkOp(), no degradation over time was observed. This is easily reproduced and repeatable. But after the customer has implemented bulk() in his C# code, the same degradation over time was observed. Expected behaviour.C# program to go faster (or at least not worse) than a Javascript script running in the shell. Details.Indexes
Documents
Javascript
C#
Environment If needed, I can provide the server & access I am running these tests on, it is on AWS. Thank you, |
| Comments |
| Comment by Dmitry Agranat [ 21/Jun/15 ] |
|
craiggwilson, the difference in the results is due to the difference between Javascript and C# code. In Javascript sample above, I am not randomizing data before inserting. Once the Javascript was fixed, there is insignificant difference between Javascript and C#. You can close this as "works as designed". |
| Comment by Craig Wilson [ 11/Jun/15 ] |
|
Using InsertManyAsync is exactly the same: https://github.com/mongodb/mongo-csharp-driver/blob/master/src/MongoDB.Driver/MongoCollectionBase.cs#L130 |
| Comment by Dmitry Agranat [ 11/Jun/15 ] |
|
Maybe we should use Bulk() API in C# code to make it equal to db.collection.initializeUnorderedBulkOp()? |