jsPerf.com source code
JavaScript PHP CSS
Latest commit 002825b Oct 24, 2014 @mathiasbynens Merge pull request #203 from d10/button-titles
Add `title`s to buttons to include JS libraries
Failed to load latest commit information.
_api Initial commit. Oct 29, 2011
_css Reduce default <iframe> height Aug 24, 2013
_inc Limit <textarea> input to 16,777,215 characters Jun 26, 2013
_jar Initial commit. Oct 29, 2011
_tmp Tweak build script now that Benchmark.js and Platform.js use `root` i… Sep 6, 2013
_tpl Update FAQ about setup and teardown Oct 21, 2014
.gitattributes Initial commit. Oct 29, 2011
.gitignore Ignore changes to JavaScript dependencies Dec 10, 2011
.htaccess .htaccess: Make sure to hide `.git` directory on malconfigured hosts Sep 6, 2013
GPL-LICENSE.txt Initial commit. Oct 29, 2011
MIT-LICENSE.txt Initial commit. Oct 29, 2011
README.md README: Add instructions on running a quick PHP server Nov 5, 2012
apple-touch-icon-precomposed.png Initial commit. Oct 29, 2011
apple-touch-icon.png Initial commit. Oct 29, 2011
favicon.ico Initial commit. Oct 29, 2011
index.php Don’t let robots index non-published test cases Jun 9, 2012
robots.txt Initial commit. Oct 29, 2011
server.sh README: Add instructions on running a quick PHP server Nov 5, 2012


jsPerf.com source code

jsPerf.com runs on a server with Apache or Lighttpd, MySQL and PHP installed.

How to run a local copy of jsPerf for testing/debugging

  1. Download the source code, as located within this repository.
  2. The code expects things to be hosted at / and not a subdirectory. You might want to create a new virtual host, e.g. dev.jsperf.com.
  3. Use _tmp/database.sql to create the jsPerf tables in a database of choice.
  4. Rename _inc/config.sample.php to _inc/config.php and enter your database credentials and other info.
  5. For the Browserscope integration to work, you’ll need a Browserscope API key. To get one, sign in at Browserscope.org and then browse to the settings page.
  6. If you are using Apache, edit .htaccess (especially the first few lines) so it matches your current setup. If you are using Lighttpd, set up the dev.jsperf.com virtual host using the sample in _inc/lighttpd.conf.
  7. If you plan on using the update script for Benchmark.js/Platform.js (_tmp/build.php), you’ll need to make some files writable.

    chmod 666 _js/benchmark.js _js/benchmark.src.js _js/platform.src.js\
    _js/ui.browserscope.src.js _js/ui.src.js _inc/version.txt

Note that both include_path and open_basedir must be set to ./:./_tpl/:./_tpl/tpl-inc/:./_inc/.

With PHP 5.4 you can easily start an HTTP web server with these settings for quick testing:

php -d include_path="./:./_tpl/:./_tpl/tpl-inc/:./_inc/" -d open_basedir="./:./_tpl/:./_tpl/tpl-inc/:./_inc/" -d session.save_path="_session" -S localhost:8000


The source code for jsPerf is copyright © Mathias Bynens and dual-licensed under the MIT and GPL licenses.

You don’t have to do anything special to choose one license or the other and you don’t have to notify anyone which license you are using. You are free to re-use parts of this code in commercial projects as long as the copyright header (as mentioned in GPL-LICENSE.txt and MIT-LICENSE.txt) is left intact.