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
This is a workaround for the issue of window.setTimeout, that it is being paused in iOS Safari during touch events
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();
Benchmark.prototype.setup = function() {
function sum(){return 1+1};
AudioTimeout = {
set: function(callback, length) {
if (length <= 0) {
length = 1;
}
var source = context.createBufferSource();
source.buffer = context.createBuffer(1, 32000 * (length / 1000), 32000);
source.connect(context.destination);
source.onended = callback;
if (!source.stop) {
source.stop = source.noteOff;
}
if (!source.start) {
source.start = source.noteOn;
}
source.start(0);
return source;
},
clear: function(source){
source.stop(0);
}
};
};
Ready to run.
Test | Ops/sec | |
---|---|---|
audio timeout |
| ready |
setTimeout |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.