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="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
// thunk
var setTimeoutPromise = function(ms) {
return new Promise(function(resolve, reject){
setTimeout(resolve, ms);
});
};
window.generatorFunction = function*() {
yield setTimeoutPromise(1);
yield setTimeoutPromise(1);
};
window.module = {
exports: null
};
window.runParallel = function(fn, cb) {
var yetToReturn = numCallsToMake = 10000;
var fnCb = function() {
if (0 === --yetToReturn) cb();
};
while (0 < numCallsToMake--) {
fn(fnCb);
}
};
$.getScript("https://raw.github.com/petkaantonov/bluebird/master/js/browser/bluebird.js", function() {
$.getScript("https://raw.github.com/visionmedia/co/master/index.js", function() {
window.co = window.module.exports;
window.bluebirdPrepared = Promise.coroutine(generatorFunction);
window.coPrepared = co(generatorFunction);
console.log('Tools setup');
});
});
});
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Bluebird: Promise.spawn |
| ready |
co |
| ready |
Bluebird: Promise.coroutine (prepared) |
| ready |
co (prepared) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.