Hit the mark with your benchmarks. https://riveragroup.github.io/benchmarksman/
|
|
11 lat temu | |
|---|---|---|
| example | 11 lat temu | |
| lib | 11 lat temu | |
| test | 11 lat temu | |
| .gitignore | 11 lat temu | |
| .jscsrc | 11 lat temu | |
| .jshintignore | 11 lat temu | |
| .jshintrc | 11 lat temu | |
| README.md | 11 lat temu | |
| benchmarksman.js | 11 lat temu | |
| main.js | 11 lat temu | |
| package.json | 11 lat temu |
A handy wrapper around benchmark.js to make writing benchmarks as easy as writing test cases (in mocha via the exports UI).
Using benchmark.js directly can be a little tedious if you just want it to get the ops/sec for a bunch of different code snippets.
Below are some of the ways to use benchmarksman in your project.
If instant gratification is your thing, then get your fix with a live demo and run some quick benchmarks on the playground site.
benchmarksman bench/array.js
exports.dateGetTime = {
"#getTime()": function() {
new Date().getTime();
},
".now()": function() {
Date.now();
},
};
if (!module.main) require("benchmarksman").runner(exports);
Date #getTime() x 7,705,532 ops/sec ±2.95% (94 runs sampled)
Date .now() x 15,132,312 ops/sec ±1.85% (94 runs sampled)