()
| 256 | |
| 257 | // Find Interlaced Updates -> same as now except mix up customId val (increment by 10000?) |
| 258 | function perfFindInterlacesUpdates() { |
| 259 | var start, end; |
| 260 | var totalTimes = []; |
| 261 | var totalMS = 0; |
| 262 | |
| 263 | for (var idx = 0; idx < arraySize; idx++) { |
| 264 | //var customidx = Math.floor(Math.random() * arraySize) + 1; |
| 265 | |
| 266 | start = process.hrtime(); |
| 267 | var results = samplecoll.find({ |
| 268 | 'customId': idx |
| 269 | }); |
| 270 | // just call update on document to force index rebuild |
| 271 | samplecoll.update(results[0]); |
| 272 | |
| 273 | end = process.hrtime(start); |
| 274 | totalTimes.push(end); |
| 275 | } |
| 276 | |
| 277 | for (var idx = 0; idx < totalTimes.length; idx++) { |
| 278 | totalMS += totalTimes[idx][0] * 1e3 + totalTimes[idx][1] / 1e6; |
| 279 | } |
| 280 | |
| 281 | totalMS = totalMS.toFixed(2); |
| 282 | var rate = arraySize * 1000 / totalMS; |
| 283 | rate = rate.toFixed(2); |
| 284 | console.log("interlaced updates + coll.find() : " + totalMS + "ms (" + rate + " ops/s) " + arraySize + " iterations"); |
| 285 | } |
| 286 | |
| 287 | console.log(""); |
| 288 | console.log("Perf: Unindexed Inserts---------------------"); |
no outgoing calls
no test coverage detected
searching dependent graphs…