lodash.size vs lodash.keys
Date tested:
4 years ago
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Test name
Executions per second
lodash.size
2907984.0 Ops/sec
lodash.keys
3250919.0 Ops/sec
Benchmark definition (click to collapse):
HTML Preparation code:
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js
Script Preparation code:
var collection = {a: 30310, b: 100303, c: 3040494};
Tests:
lodash.size
_.size(collection)
lodash.keys
_.keys(collection)
Open this result on MeasureThat.net