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
Comparing dumb code I've seen vs a simple loop
const
userTemplate = (user) => {
output += `<li><a href="${user.email}">${user.name}</a></li>`
};
let
output = '',
users = [
{
name : "John",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Jimbo",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Jenna",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Jason",
contact : false,
email : "dummy@blackhole.com"
},{
name : "Joker",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Jakamoon",
contact : false,
email : "dummy@blackhole.com"
},{
name : "Jacob",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Jospeh",
contact : false,
email : "dummy@blackhole.com"
},{
name : "Josepus",
contact : true,
email : "dummy@blackhole.com"
},{
name : "Blaine",
contact : false,
email : "dummy@blackhole.com"
}
];
for (let i = 0; i < 8; i++) {
users = users.concat(users);
}
output = '';
Ready to run.
Test | Ops/sec | |
---|---|---|
filter.forEach |
| ready |
for...of |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.