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
Compare namespaced functions, wrapped inside anonymous scope vs default functions.
function Core() {};
Core.prototype = Core;
(function() {
var ii = 0;
var result = 0;
Core.test1 = function(length) {
result = 0;
ii = 0;
for (; ii < length; ++ii) {
++result;
};
};
})();
var kk = 0;
var res = 0;
Core.test2 = function(length) {
res = 0;
kk = 0;
for (; kk < length; ++kk) {
++res;
};
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Anonymous namespace wrapped |
| ready |
Global scoped function |
| ready |
infinity |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.