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>
var UnreducedDSP = function() {
this.buffer = new Float32Array(1024);
};
UnreducedDSP.prototype.generate = function() {
var frequency = 200;
var buffer = this.buffer;
var bufferLength = buffer.length;
for (var i=0; i<bufferLength; i++) {
// Change the frequency half way through the buffer
if (i == 512) {
frequency += 100;
}
buffer[i] = Math.exp(frequency);
}
};
var ReducedDSP = function() {
this.buffer = new Float32Array(1024);
};
ReducedDSP.prototype.generate = function() {
var frequency = 200;
var lastFrequency = frequency;
var value = Math.exp(frequency);
var buffer = this.buffer;
var bufferLength = buffer.length;
for (var i=0; i<bufferLength; i++) {
// Change the frequency half way through the buffer
if (i == 512) {
frequency += 100;
}
if (frequency != lastFrequency) {
value = Math.exp(frequency);
lastFrequency = frequency;
}
buffer[i] = value;
}
};
var unreducedDSP = new UnreducedDSP();
var reducedDSP = new ReducedDSP();
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Unreduced |
| ready |
Reduced |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.