Created
February 20, 2013 09:16
-
-
Save faridnsh/4994209 to your computer and use it in GitHub Desktop.
Sugar multi match benchmark
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 Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
require('./release/sugar-full.development'); | |
var empty = []; | |
var with500 = []; | |
500..times(function () { | |
with500.push({}); | |
}); | |
// add tests | |
suite.add('emptyArray.Find(emptyFunction)', function() { | |
empty.find(function () {}); | |
}).add('arrayWith500.Find(emptyFunction)', function() { | |
with500.find(function () {}); | |
}) | |
// add listeners | |
.on('cycle', function(event) { | |
console.log(String(event.target)); | |
}) | |
// run async | |
.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment