[SERVER-1316] single object update, by _id, seems slow Created: 28/Jun/10 Updated: 12/Jul/16 Resolved: 19/Apr/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Dwight Merriman | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
see test code below. 11 sec for multi update vs. 70sec from the shell on localhost. that seems like an awfully big difference to me. surely can be better for the iterative case? ----------------------- x = { classname: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; t = db.foo; start = new Date(); for( var i = 0; i < 500000; i++ ) print("insert done"); print(t.count()); start = new Date(); // multi update version , { $set: { classname: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb"} }, false, true); /* manual iteration version ).forEach( // slower: { u.classname="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbb"; t.save(u); } // e.g., 70sec print("modifications done"); print(t.count()); |
| Comments |
| Comment by Dwight Merriman [ 31/Aug/11 ] |
|
call db.getLastError() after the insert. this is not done the problem could be that the shell is slow – it can't keep up with |
| Comment by Eliot Horowitz (Inactive) [ 31/Aug/11 ] |
|
Not sure what you mean - can you try 2.0.0-rc0, and if there are problems open a ticket with your issues. |
| Comment by free [ 31/Aug/11 ] |
|
Could you please explain a bit how to resolve? or the where is the source code about this issue |
| Comment by Eliot Horowitz (Inactive) [ 28/Jun/10 ] |
|
I'm 90% sure its because of |