0.0.6 • Published 9 years ago

ybm v0.0.6

Weekly downloads
12
License
MIT
Repository
github
Last release
9 years ago

ybm

Your benchmark.

CLI

Install

npm install --global ybm

Usage

  • Watch

    ybm --watch some-benchmark-file

    When some-benchmark-file updated, will trigger re-benchmark this file.

  • Cycle

    ybm --cycle 3 some-benchmark-file

    Run some-benchmark-file three times.

  • NVM - switch node version to run your benchmark file

    ybm --nvm "iojs-v1.0.4, iojs-v2.0.0" some-benchmark-file

    Run some-benchmark-file on iojs-v1.0.4 and iojs-v2.0.0

Using ybm -h to see more help.

NODE

Install

npm install --save ybm

Usage

  • Single test:

    ybm(function() {
      // do task
    });
  • Async test:

    ybm(function(done) {
      setTimeout(done, 100);
    });
  • Suite tests:

    ybm.suite({
      'test_1': function() { /* do task */ },
      'test_2': function() { /* do task */ },
      'test_3': function() { /* do task */ }
    });  
  • Cycle suite tests:

    ybm.cycle(5, {
      'test_1': function() { /* do task */ },
      'test_2': function() { /* do task */ },
      'test_3': function() { /* do task */ }
    });
  • Matrix suite tests:

    var matrix = [
      row1,
      row2,
      //...
    ];
    
    ybm.matrix(matrix, function(row) {
      // create suite according row
      return suite;
    })

TODO

  • Add ybm.cycle - 2015/06/23
  • Support nvm to switch node test - 2015/06/24

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

Thanks

  • benchmark - A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results.

History

CHANGELOG

License

Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.