Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Latest commit

 

History

History
30 lines (22 loc) · 913 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 913 Bytes

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