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
<div id="text">Let's change this text</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
var XCMSJQ = XCMSJQ || {};
XCMSJQ.perf = XCMSJQ.perf || {};
XCMSJQ.perf.css = XCMSJQ.perf.css || {};
XCMSJQ.perf.css['reg'] = new RegExp('-', 'i');
XCMSJQ.perf.css['name'] = function() {
var tthis = arguments[0],
noregtest = arguments[1] == true;
if (!noregtest || XCMSJQ.perf.css['reg'].test(tthis)) {
var thisA = tthis.split('-');
for (var thisI = 1, thisL = thisA.length; thisI < thisL; thisI++) thisA[thisI].charAt(0).toUpperCase() + thisA[thisI].slice(1);
return thisA.join('');
} else return tthis;
};
XCMSJQ.perf.css['set'] = function() {
var node = arguments[0],
obj = arguments[1],
noregtest = arguments[2];
if (node && node.jquery) {
var nodeL = node.length;
if (nodeL == 1) return XCMSJQ.perf.css['set1'](node[0], obj, noregtest);
nodeA = node;
} else {
return XCMSJQ.perf.css['set1'](node, obj, noregtest);
}
for (var nodeI = 0, nodeL = nodeA.length; nodeI < nodeL; nodeI++) {
var n = nodeA[nodeI];
for (var objn in obj) n.style[XCMSJQ.perf.css['name'](objn, noregtest)] = obj[objn];
}
};
XCMSJQ.perf.css['set1'] = function() {
var node = arguments[0],
obj = arguments[1],
noregtest = arguments[2],
node = node && node.jquery ? node[0] : node;
for (var objn in obj) node.style[XCMSJQ.perf.css['name'](objn, noregtest)] = obj[objn];
};
XCMSJQ.perf.css['get'] = function() {
var node = arguments[0],
name = arguments[1],
noregtest = arguments[2],
node = node && node.jquery ? node[0] : node,
obj = {};
if (XCMSJQ.perf.array['is'](name)) {
for (var nameI = 0, nameL = name.length; nameI < nameL; nameI++) {
obj[name[nameI]] = node.style[XCMSJQ.perf.css['name'](name[nameI], noregtest)];
}
return obj;
} else {
return node.style[XCMSJQ.perf.css['name'](name, noregtest)];
}
};
Ready to run.
Test | Ops/sec | |
---|---|---|
XCMS $ (1) |
| ready |
XCMS $ - (multi) |
| ready |
XCMS $ - (1) |
| ready |
XCMS $ (multi) |
| ready |
Hybrid (multi el support) |
| ready |
jQuery |
| ready |
Javascript |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.