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
<canvas id="screen"></canvas>
<script>
var ctx = document.getElementById("screen").getContext("2d");
var image = document.createElement("img");
image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";
function fasterRound(value)
{
return(~~(value+(value > 0 ? .5 : -.5)));
}
function fasterRoundPos(value)
{
return(~~(value+0.5));
}
function nop(value) { return(value); }
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
whole pixel |
| ready |
sub pixel |
| ready |
whole pixels 2 |
| ready |
integer pixel |
| ready |
whole pixels 3 |
| ready |
integer nop pixel |
| ready |
whole pixels 4 |
| ready |
sub nop pixel |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.