Last active
August 29, 2015 14:10
-
-
Save bjornstar/92db35bb55d13f26a5fa to your computer and use it in GitHub Desktop.
rumplestiltskin vs sigmund
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
var r = require('rumplestiltskin'); | |
var s = require('sigmund'); | |
var a = []; | |
function bench(fn) { | |
console.time(fn.name + ' complex'); | |
for (var i = 0; i < 1000000; i += 1) { | |
a[i] = fn({ a: 1, b: true, c: null, d: {}, e: [], f: 'asdf', g: { h: { i: '1234' } } }); | |
} | |
console.timeEnd(fn.name + ' complex'); | |
console.time(fn.name + ' simple'); | |
for (var i = 0; i < 1000000; i += 1) { | |
a[i] = fn({ a: 'aaaaaaaaaaaaaaaaa' }); | |
} | |
console.timeEnd(fn.name + ' simple'); | |
} | |
bench(r.trueName); | |
bench(s); |
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
{ | |
"name": "object-hash-bench", | |
"dependencies": { | |
"rumplestiltskin": "*", | |
"sigmund": "*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment