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 type="module">
import { css } from "https://unpkg.com/@microsoft/fast-element@2.0.0/dist/fast-element.min.js"
globalThis.css = css;
const CustomStatesSetSupported = CSS.supports('selector(:state(g))');
const statesMap = new Map();
globalThis.stateSelector = function stateSelector(state) {
return (statesMap.get(state) ??
statesMap
.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`)
.get(state));
}
</script>
const fooState = stateSelector('foo');
const barState = stateSelector('bar');
const bazState = stateSelector('baz');
const fooPartial = css.partial`:is(:state(foo), [state--foo])`;
const barPartial = css.partial`:is(:state(bar), [state--bar])`;
const bazPartial = css.partial`:is(:state(baz), [state--baz])`;
Ready to run.
Test | Ops/sec | |
---|---|---|
StateSelector |
| ready |
CSS Partial |
| ready |
state consts |
| ready |
partial consts |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.