jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src='http://documentcloud.github.com/underscore/underscore.js'></script>
<script src='http://documentcloud.github.com/backbone/backbone-min.js'></script>
<script src='http://aralejs.org/dist/seajs/1.1.0/sea.js'></script>
<script src='http://aralejs.org/dist/class/0.9.0/class.js'></script>
<script>
seajs.use('class/0.9.0/class', function(Class) {
seajs.Class = Class;
});
</script>
<script src='http://mootools.net/download/get/mootools-core-1.4.5-full-nocompat.js'></script>
var context = window
, old = context.klass
, f = 'function'
, fnTest = /xyz/.test(function () {xyz}) ? /\bsupr\b/ : /.*/
, proto = 'prototype'
function klass(o) {
return extend.call(isFn(o) ? o : function () {}, o, 1)
}
function isFn(o) {
return typeof o === f
}
function wrap(k, fn, supr) {
return function () {
var tmp = this.supr
this.supr = supr[proto][k]
var ret = fn.apply(this, arguments)
this.supr = tmp
return ret
}
}
function process(what, o, supr) {
for (var k in o) {
if (o.hasOwnProperty(k)) {
what[k] = isFn(o[k])
&& isFn(supr[proto][k])
&& fnTest.test(o[k])
? wrap(k, o[k], supr) : o[k]
}
}
}
function extend(o, fromSub) {
// must redefine noop each time so it doesn't inherit from previous arbitrary classes
function noop() {}
noop[proto] = this[proto]
var supr = this
, prototype = new noop()
, isFunction = isFn(o)
, _constructor = isFunction ? o : this
, _methods = isFunction ? {} : o
function fn() {
if (this.initialize) this.initialize.apply(this, arguments)
else {
fromSub || isFunction && supr.apply(this, arguments)
_constructor.apply(this, arguments)
}
}
fn.methods = function (o) {
process(prototype, o, supr)
fn[proto] = prototype
return this
}
fn.methods.call(fn, _methods).prototype.constructor = fn
fn.extend = arguments.callee
fn[proto].implement = fn.statics = function (o, optFn) {
o = typeof o == 'string' ? (function () {
var obj = {}
obj[o] = optFn
return obj
}()) : o
process(this, o, supr)
return this
}
return fn
}
klass.noConflict = function () {
context.klass = old
return this
}
context.klass = klass
Ready to run.
Test | Ops/sec | |
---|---|---|
backbone |
| ready |
mootools |
| ready |
arale |
| ready |
klass |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.