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
var getJson = () => ({
"name": "react-dom",
"version": "18.2.0",
"description": "React package for working with the DOM.",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
},
"keywords": [
"react"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/facebook/react/issues"
},
"homepage": "https://reactjs.org/",
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.0"
},
"peerDependencies": {
"react": "^18.2.0"
},
"files": [
"LICENSE",
"README.md",
"index.js",
"client.js",
"profiling.js",
"server.js",
"server.browser.js",
"server.node.js",
"test-utils.js",
"cjs/",
"umd/"
],
"exports": {
".": "./index.js",
"./client": "./client.js",
"./server": {
"deno": "./server.browser.js",
"worker": "./server.browser.js",
"browser": "./server.browser.js",
"default": "./server.node.js"
},
"./server.browser": "./server.browser.js",
"./server.node": "./server.node.js",
"./profiling": "./profiling.js",
"./test-utils": "./test-utils.js",
"./package.json": "./package.json"
},
"browser": {
"./server.js": "./server.browser.js"
},
"browserify": {
"transform": [
"loose-envify"
]
}
})
function deepFreezeJson(json) {
if (!json || typeof json !== 'object') {
return json;
}
Object.freeze(json);
for (const value of Object.values(json)) {
deepFreezeJson(value);
}
return json;
}
function deeperFreezeJson(json) {
Object.freeze(json);
if (json && typeof json === 'object') {
for (const value of Object.values(json)) {
deepFreezeJson(value);
}
}
return json;
}
function deeperFreezeJson2(json) {
Object.freeze(json);
if (json && typeof json === 'object') {
Object.values(json).forEach(deepFreezeJson);
}
return json;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
deep freeze |
| ready |
deeper freeze |
| ready |
deeper freeze 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.