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
const MAX_SIZE_WITH_BUFFER = (4 * 1024 * 1024) * .8;
function doesMessageExceedMaxSize(items, maxSize) {
const serialized = JSON.stringify(items);
return serialized.length > maxSize;
}
function createMockProduct(id, size) {
const baseProduct = {
external_id: `gid://shopify/Product/${id}`,
external_created_at: new Date().toISOString(),
external_updated_at: new Date().toISOString(),
title: `Test Product ${id}`,
description: "A test product",
vendor: "Test Vendor",
product_type: "Test Type",
status: "ACTIVE",
tags: ["test", "benchmark"],
};
if (size === "medium") {
return {
...baseProduct,
description: baseProduct.description.repeat(50),
tags: Array.from({ length: 20 }, (_, i) => `tag-${i}`),
};
}
if (size === "large") {
return {
...baseProduct,
description: baseProduct.description.repeat(200),
tags: Array.from({ length: 100 }, (_, i) => `tag-${i}`),
};
}
return baseProduct;
}
const testProducts = Array.from({ length: 500 }, (_, i) => {
const size = i % 3 === 0 ? "large" : i % 3 === 1 ? "medium" : "small";
return createMockProduct(i, size);
});
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Imperative | | ready |
| reduce | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.