Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash.js vs Native AndyDomFrankie
(version: 0)
Comparing performance of:
Lodash.js filter vs Andy vs Dom vs Frankie
Created:
4 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
var tests = { _emptyObj: {}, _emptyArr: [], _zero: 0, _emptyString: '', _null: null, _undef: undefined, _falsy: false, _notemptyObj: {a:1, b:2}, _notemptyArr: [1,2,3], _notzero: 10, _notemptyString: 'hello', _notfalsy: true, }; var myIsEmpty = (data) => (typeof data !== 'object' ? !data : data === null || !Object.keys(data).length); var domIsEmpty = (data) => { if (typeof data === "object") { if(!data) return true; if (Array.isArray(data)) return !data.length; return !Object.keys(data).length } else { return !data } } var frankieIsEmpty = data => { return typeof data === 'object' && data !== null ? !Object.keys(data).length : !data; } var testFunction = (fun) => Object.keys(tests).map((key) => fun(tests[key]))
Tests:
Lodash.js filter
testFunction(_.isEmpty);
Andy
testFunction(myIsEmpty);
Dom
testFunction(domIsEmpty);
Frankie
testFunction(frankieIsEmpty);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Lodash.js filter
Andy
Dom
Frankie
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
isEmpty vs Object.keys
Native Object.values().some() vs lodash _.some()
Comparing performance of native .length and Lodash _.isEmpty v2
Lodash isEmpty vs Native Javascript
lodash has vs object.hasOwn
Comments
Confirm delete:
Do you really want to delete benchmark?