Skip to content

Instantly share code, notes, and snippets.

@alFReD-NSH
Created February 20, 2013 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alFReD-NSH/4994209 to your computer and use it in GitHub Desktop.
Save alFReD-NSH/4994209 to your computer and use it in GitHub Desktop.
Sugar multi match benchmark
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