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
test
test
const orderMessages = new Map([
['pending', 'Order is pending.'],
['shipped', 'Order has been shipped.'],
['delivered', 'Order has been delivered.'],
]);
function getOrderMessage(status) {
return orderMessages.get(status);
}
console.log(getOrderMessage('pending')); // "Order is pending."
console.log(getOrderMessage('shipped')); // "Order has been shipped."
console.log(getOrderMessage('delivered')); // "Order has been delivered."
const orderMessages = new Map([
['pending', 'Order is pending.'],
['shipped', 'Order has been shipped.'],
['delivered', 'Order has been delivered.'],
]);
function getOrderMessage(status) {
return orderMessages.get(status);
}
console.log(getOrderMessage('pending')); // "Order is pending."
console.log(getOrderMessage('shipped')); // "Order has been shipped."
console.log(getOrderMessage('delivered')); // "Order has been delivered."
Ready to run.
Test | Ops/sec | |
---|---|---|
if |
| ready |
object |
| ready |
switch-case |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.