Hit the mark with your benchmarks. https://riveragroup.github.io/benchmarksman/
|
|
11 лет назад | |
|---|---|---|
| example | 11 лет назад | |
| lib | 11 лет назад | |
| test | 11 лет назад | |
| .gitignore | 11 лет назад | |
| .jshintrc | 11 лет назад | |
| README.md | 11 лет назад | |
| benchmarksman.js | 11 лет назад | |
| main.js | 11 лет назад | |
| package.json | 11 лет назад |
A handy wrapper around benchmark.js to make writing benchmarks as easy as writing test cases (using the mocha exports UI).
Using benchmark.js directly can be a little tedious if you just want it to log ops/sec for a bunch of different code snippets.
benchmarksman bench/array.js
exports.Date = {
"#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)