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 EMBEDDED_ENTRY_BLOCK_ALIAS = "embedded-entry-block";
const COUNTABLE_TAGS_LIST = ["p", "ul", "ol"];
const INJECTION_INTERVAL = 3;
const WATERFALL_UNITS = [
{
shouldDisplay: () => false,
component: "waterfall unit injected 0 - hidden",
},
{
shouldDisplay: () => true,
component: "waterfall unit injected 1",
},
{
shouldDisplay: () => true,
component: "waterfall unit injected 2",
},
{
shouldDisplay: () => true,
component: "waterfall unit injected 3",
},
{
shouldDisplay: () => false,
component: "waterfall unit injected 4 - hidden",
},
{
shouldDisplay: () => true,
component: "waterfall unit injected 5",
},
{
shouldDisplay: () => false,
component: "waterfall unit injected 6 - hidden",
},
];
const MOCKED_CONTENT = [
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { children: "element" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "h2-rte", children: "section" } },
{ props: { as: EMBEDDED_ENTRY_BLOCK_ALIAS, children: "embeded unit" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { children: "element" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "h2-rte", children: "section" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "h2-rte", children: "section" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { children: "element" } },
{ props: { as: "ol", children: "ordered list" } },
{ props: { as: "ul", children: "unordered list" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
{ props: { as: "p", children: "paragraph" } },
];
const isCountableNodeForContentInjection = (node) => {
const tagAlias = node?.props?.as;
return COUNTABLE_TAGS_LIST.includes(tagAlias);
};
const isNodeEmebededEntryBlock = (node) => node?.props?.as === EMBEDDED_ENTRY_BLOCK_ALIAS;
Ready to run.
Test | Ops/sec | |
---|---|---|
mutable approach |
| ready |
immutable approach |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.