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 rect = [1, 2, 3, 4];
var thi = [0, 0, 100, 100];
function contains(pt) {
return (pt[0] >= thi[0] && pt[0] <= thi[0] + thi[2] && pt[1] >= thi[1] && pt[1] <= thi[1] + thi[3]);
}
function fn1(rect) {
return (contains(rect[0], rect[1]) && contains(rect[0] + rect[2], rect[1]) && contains(rect[0] + rect[2], rect[1] + rect[3]) && contains(rect[0], rect[1] + rect[3]));
}
function fn2(rect) {
var right = rect[0] + rect[2],
bot = rect[1] + rect[3];
return (contains(rect[0], rect[1]) && contains(right, rect[1]) && contains(right, bot) && contains(rect[0], bot));
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
fn1 |
| ready |
fn2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.