Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Object.fromEntries + Object.entries vs Object.keys
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0
Browser:
Chrome 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Object.keys
903K/s
Object.fromEntries + Object.entries
881K/s
View exact numbers
Test name
Executions per second
✓
Object.keys
902,920 Ops/sec
Object.fromEntries + Object.entries
881,085 Ops/sec
Script Preparation code:
var obj = {v1: {value: 'string', num: 123, obj: {boo: true, arr: [{str: 'string'},{str: 'string'},{str: 'string'},{str: 'string'},{str: 'string'}]}}, v2: {value: 'string', num: 123, obj: {boo: true, arr: [{str: 'string'},{str: 'string'},{str: 'string'},{str: 'string'},{str: 'string'}]}}}
Tests:
Object.fromEntries + Object.entries
JSON.stringify(Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, {...value, obj: value.obj.arr}])))
Object.keys
const newObj = {} Object.keys(obj).forEach(key => { newObj[key] = { ...obj[key], ccSubset: obj[key]?.ccSubset?.ccSubset }; }); JSON.stringify(newObj)