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 responsiveKeys = [
// border
'border',
'borderWidth',
'borderColor',
'borderStyle',
'borderRadius',
'borderHorizontal',
'borderVertical',
'borderTop',
'borderTopWidth',
'borderTopColor',
'borderTopStyle',
'borderTopRightRadius',
'borderTopLeftRadius',
'borderRight',
'borderRightWidth',
'borderRightColor',
'borderRightStyle',
'borderBottom',
'borderBottomWidth',
'borderBottomColor',
'borderBottomStyle',
'borderBottomRightRadius',
'borderBottomLeftRadius',
'borderLeft',
'borderLeftWidth',
'borderLeftColor',
'borderLeftStyle',
// color
'color',
'backgroundColor',
// grid
'columnGap',
'templateColumns',
'autoColumns',
'rowGap',
'templateRows',
'autoRows',
'autoFlow',
'templateAreas',
'justifyItems',
'alignItems',
'justifyContent',
'alignContent',
// grid item
'column',
'columnStart',
'columnEnd',
'row',
'rowStart',
'rowEnd',
'justifySelf',
'alignSelf',
// flex
'flexDirection',
'flexWrap',
// flex item
'flexGrow',
'flexShrink',
'flexBasis',
'order',
// layout
'display',
'width',
'minWidth',
'maxWidth',
'height',
'minHeight',
'maxHeight',
'verticalAlign',
'overflow',
// spacing
'margin',
'marginHorizontal',
'marginVertical',
'marginTop',
'marginRight',
'marginBottom',
'marginLeft',
'padding',
'paddingHorizontal',
'paddingVertical',
'paddingTop',
'paddingRight',
'paddingBottom',
'paddingLeft',
// typography
'textAlign',
]
function transform(value) {
return value
}
const objectLookup = responsiveKeys.reduce((acc, key) => {
acc[key] = transform
return acc
})
const mapLookup = new Map()
responsiveKeys.forEach((acc, key) => {
mapLookup.set(key, transform)
})
Ready to run.
Test | Ops/sec | |
---|---|---|
Map.get |
| ready |
Object[key] |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.