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>
(function(module){
'use strict';
var inherit = function(Child, Parent) {
var Bridge = function() {};
Bridge.prototype = Parent.prototype;
Child.prototype = new Bridge();
Child.superclass = Parent.prototype;
Child.prototype.constructor = Child;
};
var slice = Array.prototype.slice,
unshift = Array.prototype.unshift;
var mixin = function() {
var args = slice.call(arguments, 0),
target = args.shift(),
source, p;
while ((source = args.shift())) {
for (p in source) {
// 保留属性 mixins
if (p === 'mixins') {
source[p].unshift(target);
mixin.apply(null, source[p]);
} else {
target[p] = source[p];
}
}
}
};
var Class = function() {};
Class.superclass = Class.prototype = {
// constructor: Class,
/**
* 初始化方法,实例化时自动执行
*
* @method initialize
*/
initialize: function() {},
extend: function( /*[properties[, ... properties]]*/ ) {
Array.prototype.unshift.call(arguments, this);
mixin.apply(null, arguments);
return this;
}
};
Class.create = function( /*[Parent][, properties[, ... properties]]*/ ) {
var args = slice.call(arguments, 0),
Dummy,
Parent;
Dummy = function() {
this.initialize.apply(this, arguments);
};
if (args[0] && typeof args[0] === 'function') {
Parent = args.shift();
// 确保继承自 Class 或 Class 的子类
if (!Parent.superclass) {
inherit(Parent, Class);
}
} else {
Parent = Class;
}
inherit(Dummy, Parent);
if (args.length) {
args.unshift(Dummy.prototype);
mixin.apply(null, args);
}
Dummy.extend = function( /*[properties[, ... properties]]*/ ) {
unshift.call(arguments, Dummy);
return Class.create.apply(null, arguments);
};
return Dummy;
};
module.CrossClass= Class;
})(window);
</script>
<script src="http://libs.baidu.com/mootools/1.4.5/mootools-yui-compressed.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
backbone |
| ready |
mootools |
| ready |
coffeescript |
| ready |
crossjs |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.