Mercurial > hg > Members > tatsuki > jungle-bench
diff mongoBenchMark/find.js @ 28:2ac12de0aaeb default tip
mongo BenchMark change
author | tatsuki |
---|---|
date | Tue, 05 May 2015 01:19:04 +0900 |
parents | 69dca2ab1783 |
children |
line wrap: on
line diff
--- a/mongoBenchMark/find.js Mon May 04 15:38:54 2015 +0900 +++ b/mongoBenchMark/find.js Tue May 05 01:19:04 2015 +0900 @@ -1,8 +1,13 @@ -use tatsuki -var date_obj = new Date(); -var milliseconds = date_obj.getTime(); -for (var i = 1; i<= 10000000 ; i++) { -var PersonId = db.collection.find({PersonId:"p:9"}); +function findDataLoop () { + for (var i = 1; i<= 50000; i++) { + var personVer = db.config.find({configVer:"v:1"}).next().PersonVer; + var personCollection = db.getCollection(personVer); + db.person1.find({PersonId:"p:9"}).next(); + } } -var date_obj = new Date(); -print(date_obj.getTime() - milliseconds) + +function findData () { + var personVer = db.config.find({configVer:"v:1"}).next().PersonVer; + var personCollection = db.getCollection(personVer); + db.person1.find({PersonId:"p:9"}).next(); +} \ No newline at end of file