Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bestiejs/benchmark.js
A benchmarking library. As used on jsPerf.com.
https://github.com/bestiejs/benchmark.js
Last synced: about 1 month ago
JSON representation
A benchmarking library. As used on jsPerf.com.
- Host: GitHub
- URL: https://github.com/bestiejs/benchmark.js
- Owner: bestiejs
- License: other
- Created: 2011-05-25T18:40:03.000Z (about 13 years ago)
- Default Branch: main
- Last Pushed: 2022-12-22T13:38:09.000Z (over 1 year ago)
- Last Synced: 2024-01-31T16:01:29.323Z (4 months ago)
- Language: JavaScript
- Homepage: https://benchmarkjs.com/
- Size: 4.47 MB
- Stars: 5,471
- Watchers: 100
- Forks: 356
- Open Issues: 52
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Lists
- awesome-javascript - benchmark.js - A benchmarking library. As used on jsPerf.com. (Benchmark / Runner)
- awesome-list - benchmark.js
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-javascript-cn - benchmark.js
- awesome-web-dev-resources - benchmark.js
- awesome-nodejs-cn - Benchmark.js - 代码性能测试工具. (目录 / 基准化)
- awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-front-end - benchmark
- my-awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-stars - benchmark.js
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. ![](https://img.shields.io/github/stars/bestiejs/benchmark.js.svg?style=social&label=Star) (Repository / Testing)
- awesome-nodejs-cn - Benchmark.js - Benchmarking 库,支持高分辨率计数器并且返回有意的统计结果 (包 / 基准化分析)
- awesome-github-star - benchmark.js
- awesome-javascript - benchmark.js - A benchmarking library. As used on jsPerf.com. (Benchmark / Runner)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome - benchmark.js - A benchmarking library. (Packages / Debug/Test)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-node - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-node.js - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- fuck-awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-nodejs-cn - Benchmark.js - Benchmarking 库,支持高分辨率计数器并且返回有意的统计结果 (包 / 基准化分析)
- awesome-nodejs-cn - Benchmark.js - **star:5491** 基准库,支持高分辨率定时器,并返回统计上显著的结果 ![star > 2000][Awesome] ![项目已归档][Archived] (包 / 基准测试)
- awesome-javascript - benchmark.js - A benchmarking library. As used on jsPerf.com. ` 📝 3 years ago ` (Benchmark [🔝](#readme))
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-javascript-libraries - benchmark.js - A benchmarking library. As used on jsPerf.com. (Benchmark / Runner)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-javascript-builds-project - benchmark.js - A benchmarking library. As used on jsPerf.com. (Benchmark / Runner)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- A-collection-of-awesome-browser-side-JavaScript-libraries-resources-and-shiny-things. - benchmark.js - A benchmarking library. As used on jsPerf.com. (Benchmark / Runner)
- awesome-stars - benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-javascript - benchmark.js
- awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-stars - bestiejs/benchmark.js - A benchmarking library. As used on jsPerf.com. (JavaScript)
- awesome-javascript - benchmark.js - A benchmarking library. As used on jsPerf.com. - ★ 3797 (Benchmark)
- awesome-nodejs - benchmark.js - A benchmarking library. As used on jsPerf.com. - ★ 3797 (Benchmarking)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-nodejs - Benchmark.js - Benchmarking library that supports high-resolution timers and returns statistically significant results. (Packages / Benchmarking)
- awesome-stars - bestiejs/benchmark.js - `★5484` A benchmarking library. As used on jsPerf.com. (JavaScript)
README
# Benchmark.js v2.1.4
A [robust](https://mathiasbynens.be/notes/javascript-benchmarking "Bulletproof JavaScript benchmarks") benchmarking library that supports high-resolution timers & returns statistically significant results. As seen on [jsPerf](https://jsperf.com/).
## Documentation
* [API Documentation](https://benchmarkjs.com/docs)
## Download
* [Development source](https://raw.githubusercontent.com/bestiejs/benchmark.js/2.1.4/benchmark.js)
## Installation
Benchmark.js’ only hard dependency is [lodash](https://lodash.com/).
Include [platform.js](https://mths.be/platform) to populate [Benchmark.platform](https://benchmarkjs.com/docs#platform).In a browser:
```html
```
In an AMD loader:
```js
require({
'paths': {
'benchmark': 'path/to/benchmark',
'lodash': 'path/to/lodash',
'platform': 'path/to/platform'
}
},
['benchmark'], function(Benchmark) {/*…*/});
```Using npm:
```shell
$ npm i --save benchmark
```In Node.js:
```js
var Benchmark = require('benchmark');
```Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
```shell
npm i --save microtime
```Usage example:
```js
var suite = new Benchmark.Suite;// add tests
suite.add('RegExp#test', function() {
/o/.test('Hello World!');
})
.add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
})
// add listeners
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
// run async
.run({ 'async': true });// logs:
// => RegExp#test x 4,161,532 +-0.99% (59 cycles)
// => String#indexOf x 6,139,623 +-1.00% (131 cycles)
// => Fastest is String#indexOf
```## Support
Tested in Chrome 54-55, Firefox 49-50, IE 11, Edge 14, Safari 9-10, Node.js 6-7, & PhantomJS 2.1.1.
## BestieJS
Benchmark.js is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, & plenty of documentation.