Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Plain js vs OmitBy(3)
Testing LoDash's omitBy agains plain js
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.1.2
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
Plain Js
738836.7 Ops/sec
LoDash OmitBy
642713.0 Ops/sec
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
Script Preparation code:
var basePalette = { black: undefined, green: null, orange: 'orange', red: null, darkRed: 'darkRed', blue: 'blue', lightBlue: 'lightBlue', navy: 'navy', blackOne: undefined, blackTwo: undefined, blackThree: undefined, blackFour: undefined, blackFive: undefined, blackSix: undefined, blackSeven: undefined, }
Tests:
Plain Js
const isNullable = (obj) => obj == undefined || obj == null || (Array.isArray(obj) && obj.length < 1) const skipNullable = (obj) => { const temp = {} Object.keys(obj).forEach((key) => { if (isNullable(obj[key])) return temp[key] = obj[key] }) return temp } skipNullable(basePalette)
LoDash OmitBy
const isNullable = (v) => v == undefined || v == null || (Array.isArray(v) && v.length < 1) _.omitBy(basePalette, isNullable )