Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
omit (reduce) vs omit (Object.fromEntries)
(version: 1)
Comparing performance of:
omit vs omit2
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function omit(obj, keys) { return keys.reduce((a, e) => { const { [e]: _, ...rest } = a; return rest; }, obj); } function omit2(obj, keys) { return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k))); }
Tests:
omit
omit({ a: 1, b: 2, c: 3 }, ['b']);
omit2
omit2({ a: 1, b: 2, c: 3 }, ['b']);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
omit
omit2
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 OPR/117.0.0.0
Browser/OS:
Opera 117 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
omit
20824730.0 Ops/sec
omit2
4754117.0 Ops/sec
Related benchmarks:
Object.values vs Reduce
reduce vs assigning with a forEach
delete property of object vs create new object
omit function testing
reducer vs fromEntries
reduce object vs object.fromentries (1K records)
Object.fromEntries vs reduce 123
Object.fromEntries vs reduce - 100 keys
omit (reduce) vs omit (Object.fromEntries) 2
Comments
Confirm delete:
Do you really want to delete benchmark?