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 src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js"></script>const orders = Array.from({ length: 1000 }, (_, i) => ({
id: i,
amount: Math.floor(Math.random() * 1000) + 10,
status: ['pending', 'processing', 'completed', 'cancelled'][Math.floor(Math.random() * 4)],
items: Math.floor(Math.random() * 5) + 1
}));
let totalRevenue = 0;
let orderCounts = { pending: 0, processing: 0, completed: 0, cancelled: 0 };
const processOrder = (order) => {
if (order.status === 'completed') {
totalRevenue += order.amount;
}
orderCounts[order.status]++;
};totalRevenue = 0;
orderCounts = { pending: 0, processing: 0, completed: 0, cancelled: 0 };Ready to run.
| Test | Ops/sec | |
|---|---|---|
| _.each | | ready |
| .forEach | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.