GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BigData-Tools/benchmark.js: A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results. As used on jsPerf.com.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

961 Commits
961 Commits

Folders and files

NameName
Last commit message
Last commit date
doc
doc
 
 
example/jsperf
example/jsperf
 
 
plugin
plugin
 
 
test
test
 
 
vendor
vendor
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
benchmark.js
benchmark.js
 
 
bower.json
bower.json
 
 
index.js
index.js
 
 
nano.jar
nano.jar
 
 
nano.java
nano.java
 
 
package.json
package.json
 
 

Repository files navigation

Benchmark.js v1.0.0

A robust benchmarking library that works on nearly all JavaScript platforms1, supports high-resolution timers, and returns statistically significant results. As seen on jsPerf.

Download

  • Development source

Dive in

We’ve got API docs and unit tests.

For a list of upcoming features, check out our roadmap.

Support

Benchmark.js has been tested in at least Chrome 531, Firefox 226, IE 6-11, Opera 9.2518, Safari 3-7, Node.js 0.6.210.10.24, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, and Rhino 1.7RC5.

Installation and usage

Benchmark.js’ only hard dependency is Lo-Dash.

In a browser:

<script src="lodash.js"></script>
<script src="benchmark.js"></script>

Optionally, expose Java’s nanosecond timer by adding the nano applet to the <body>:

<applet code="nano" archive="nano.jar"></applet>

Or enable Chrome’s microsecond timer by using the command line switch:

--enable-benchmarking

Via npm:

npm install benchmark

In Node.js and RingoJS v0.8.0+:

var Benchmark = require('benchmark');

Optionally, use the microtime module by Wade Simmons:

npm install microtime

In RingoJS v0.7.0-:

var Benchmark = require('benchmark').Benchmark;

In Rhino:

load('benchmark.js');

In an AMD loader like RequireJS:

require({
  'paths': {
    'benchmark': 'path/to/benchmark',
    'lodash': 'path/to/lodash',
    'platform': 'path/to/platform'
  }
},
['benchmark'], function(Benchmark) {
  console.log(Benchmark.platform.name);
});

Usage example:

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').pluck('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

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, and plenty of documentation.

Authors

twitter/mathias twitter/jdalton
Mathias Bynens John-David Dalton

Contributors

twitter/kitcambridge
Kit Cambridge

About

A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results. As used on jsPerf.com.

benchmarkjs.com/

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.