Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
omit (reduce) vs omit (Object.fromEntries) 2
(version: 1)
Comparing performance of:
omit 1 vs omit2 1 vs omit 8 vs omit2 8
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 1
omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['b']);
omit2 1
omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['b']);
omit 8
omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']);
omit2 8
omit2({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
omit 1
omit2 1
omit 8
omit2 8
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 1
6259850.0 Ops/sec
omit2 1
6273293.5 Ops/sec
omit 8
1159204.1 Ops/sec
omit2 8
2237010.0 Ops/sec
Related benchmarks:
Object.values vs Reduce
reduce vs assigning with a forEach
Object mapping : reduce ( object reuse ) VS. no reuse VS. fromEntries+map
delete property of object vs create new object
Object.entries + reduce VS Object.keys + forEach
Object.fromEntries vs reduce without toString2
Object.fromEntries vs reduce without tostring function
omit function testing
omit (reduce) vs omit (Object.fromEntries)
Comments
Confirm delete:
Do you really want to delete benchmark?