Skip to content

Commit

Permalink
Updated benchmarks to include poss for int strings
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfdjackson committed Apr 3, 2013
1 parent 0a6f5f2 commit 4bc9be2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion benchmark/benchmarks.js
Expand Up @@ -54,7 +54,7 @@ var suites = [
// hash(5000),
// hash(10000),
// hash(50000),
// hash(100000),
// hash(100000)
]

_.each(suites, run)
8 changes: 8 additions & 0 deletions benchmark/gen-keys.js
Expand Up @@ -25,8 +25,16 @@ var makeWord = function(){
return repeat(randInt(10), function(){ return choose(chars) }).join('')
}

var makeInt = function(){
var len = randInt(10)
return repeat(len, function(){ return randInt(9) }).join('')
}

module.exports = {
words: function(len){
return repeat(len, makeWord)
},
ints: function(len){
return repeat(len, makeInt)
}
}
10 changes: 5 additions & 5 deletions benchmark/hashes.js
Expand Up @@ -43,9 +43,9 @@ var zobel = function(str){

module.exports = {
djb2: require('string-hash'),
java: require('../src/hash').hash,
'bad java': rubbishJava,
chash: function(key){ return chash(key, max32bit) },
sedgewick: sedgewick,
zobel: zobel
java: require('../src/hash').hash
// 'bad java': rubbishJava,
// chash: function(key){ return chash(key, max32bit) },
// sedgewick: sedgewick,
// zobel: zobel
}

0 comments on commit 4bc9be2

Please sign in to comment.