/comparejs

Compare features and performance of similar js libraries (not just stats)

Primary LanguageJavaScriptMIT LicenseMIT

comparejs

Compare features and performance of similar js libraries (not just stats)

How to add performance tests for new js library

  1. Go to tests folder
  2. Add a test js file similar to below code;
var Benchmark = require('benchmark');


var id = "sample001"; //Manadatory
var suite = new Benchmark.Suite(id);
// add tests 
suite.add('RegExp#test', function() {
  /o/.test('Hello World!');
})
.add('String#indexOf', function() {
  'Hello World!'.indexOf('o') > -1;
})

module.exports = suite
  1. Add profile entry
  2. Add dev dependency in package.json (if any)
  3. run npm run benchmarktest
  4. check if a new file is generated in reports folder