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 data_array = {
count: 10000,
items: []
};
for (var i = 0; i < data_array.count; i++) {
data_array.items[i] = i;
}
function bar(item) {};
function foo(data) {
if (data.count) {
for (var i = 0; i < data.count; i++) {
bar(data.items[i]);
}
}
};
function foo2(data) {
var data_count = data.count,
data_items = data.items;
if (data_count) {
for (var i = 0; i < data_count; i++) {
bar(data_items[i]);
}
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
not optimized |
| ready |
optimized |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.