forked from felixge/node-dirty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make them work again
- Loading branch information
Showing
6 changed files
with
25 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
require('../../test/common'); | ||
var config = require('../../test/config'); | ||
var COUNT = 1e6, | ||
dirty = require('dirty')(), | ||
dirty = require(config.LIB_DIRTY)(), | ||
util = require('util'); | ||
|
||
for (var i = 0; i < COUNT; i++) { | ||
dirty.set(i, i); | ||
} | ||
|
||
var start = +new Date, i = 0; | ||
var start = Date.now(), i = 0; | ||
dirty.forEach(function(key, doc) { | ||
if (!key && key !== 0) { | ||
throw new Error('implementation fail'); | ||
} | ||
}); | ||
|
||
var ms = +new Date - start, | ||
var ms = Date.now() - start, | ||
mhz = ((COUNT / (ms / 1000)) / 1e6).toFixed(2), | ||
million = COUNT / 1e6; | ||
|
||
// Can't use console.log() since since I also test this in ancient node versions | ||
util.log(mhz+' Mhz ('+million+' million in '+ms+' ms)'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
require('../../test/common'); | ||
var config = require('../../test/config'); | ||
var COUNT = 1e6, | ||
dirty = require('dirty')(__dirname+'/../../test/tmp/benchmark-set.dirty'), | ||
dirty = require(config.LIB_DIRTY)(config.TMP_PATH + '/benchmark-set.dirty'), | ||
util = require('util'); | ||
|
||
var start = +new Date; | ||
var start = Date.now(); | ||
for (var i = 0; i < COUNT; i++) { | ||
dirty.set(i, i); | ||
} | ||
|
||
var ms = +new Date - start, | ||
var ms = Date.now() - start, | ||
mhz = ((COUNT / (ms / 1000)) / 1e6).toFixed(2), | ||
million = COUNT / 1e6; | ||
|
||
// Can't use console.log() since since I also test this in ancient node versions | ||
util.log(mhz+' Mhz ('+million+' million in '+ms+' ms)'); | ||
process.exit(0); | ||
|