[CSHARP-822] driver v1.8.2 driver query slow Created: 14/Sep/13 Updated: 25/Aug/15 Resolved: 23/Sep/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8.2 |
| Fix Version/s: | 1.8.3 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | CowVirus | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | driver | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Realize the same function of the code. like this(run environment: cpu:E5300,Memory:4GB ,win2008R2 x64): class Program static void UseMongoDbDriver1_8_2_Test() //output: Driver v1.5.0 QueryResult ToList ElapsedTime: 1445 ms } static void UseMongoDbDriver1_5_0_Test() { MongoServer server = MongoServer.Create("mongodb://127.0.0.1:27017/Test"); MongoDatabase db = MongoDatabase.Create("mongodb://127.0.0.1:27017/Test"); using (server.RequestStart(db)) { Stopwatch st = new Stopwatch(); var result = db.GetCollection("Product").FindAll().SetLimit(10).ToList(); st.Stop(); Console.WriteLine("Driver v1.5.0 Query Result ToList ElapsedTime: {0} ms", st.ElapsedMilliseconds); that maybe a bug. driver v1.5.0 query result faster than v1.8.2 ? |
| Comments |
| Comment by Githook User [ 25/Aug/15 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |
| Comment by Craig Wilson [ 23/Sep/13 ] |
|
This has also already been fixed on master due to some refactoring in the master branch. |
| Comment by auto [ 19/Sep/13 ] |
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: |
| Comment by Craig Wilson [ 19/Sep/13 ] |
|
@CowVirus, Thanks for the report. We have reproduced this result and have identified the problem. We'll be issuing a point release very soon to fix this. In the meantime, when you want to set a limit, you can use a negative number. For instance, FindAll().SetLimit(-10).ToList() will work correctly. Please keep an eye on this ticket for the fix which should come today and a 1.8.3 release to nuget and github. Craig |
| Comment by CowVirus [ 18/Sep/13 ] |
|
TestCase: databaseName : Test chanage to test |
| Comment by CowVirus [ 18/Sep/13 ] |
|
1. example document : public string Name { get; set; } } class Program static void InsertTestCollections() ); } static void Inserts(IList<TestCollection> items) ", result.Sum(s => s.Ok ? 1 : 0)); 2. my mongod is run on local 3. my mongodb setup ini:
somebody say , The cause of the issue because of "Serializer ". |
| Comment by Craig Wilson [ 17/Sep/13 ] |
|
When I run these on my local machine, I get 0ms for every single one of them. However, I don't know what data you are fetching (so I made up my own). So I have a couple further questions:
|
| Comment by CowVirus [ 17/Sep/13 ] |
|
hi,all. please download my attach files ,open my solution 's three project and test. |
| Comment by CowVirus [ 17/Sep/13 ] |
|
Thanks for your reply! |
| Comment by Craig Wilson [ 14/Sep/13 ] |
|
In addition to not calling start in your 1_5_0 test method, you also aren't using the same code. In 1_5_0, you have a server.RequestStart(db) call which doesn't exist in your 1_8_2 test. If you want accurate, apples to apples comparisons, you need to be doing the exact same thing. |
| Comment by Robert Stam [ 14/Sep/13 ] |
|
I don't see a call to st.Start() in your UseMongoDbDriver1_5_0_Test method... maybe that explains why it appears to take 0ms? It's also not clear to me how you can use two different versions of the driver in the same program. |