Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash omit vs es omit vs rest spread
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/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lodash
642247.6 Ops/sec
Object desctruct
1159225.1 Ops/sec
rest operator
3819069.8 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
Lodash
const obj = { a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, } const n = _.omit(obj, ['a','d','i']);
Object desctruct
const obj = { a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, } const omit = (originalObj = {}, keysToOmit = []) => Object.fromEntries( Object.entries(originalObj) .filter(([key]) => !keysToOmit.includes(key)) ) const n = omit(obj, ['a','d','i']);
rest operator
const obj = { a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, } const { a, d, i, ...n } = obj;