mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Optimize _.isArray fallback, baseFlatten, & _.isArguments for plain objects.
This commit is contained in:
11
perf/perf.js
11
perf/perf.js
@@ -270,6 +270,7 @@
|
||||
numbers = Array(limit),\
|
||||
fourNumbers = [5, 25, 10, 30],\
|
||||
nestedNumbers = [1, [2], [3, [[4]]]],\
|
||||
nestedObjects = [{}, [{}], [{}, [[{}]]]],\
|
||||
twoNumbers = [12, 23];\
|
||||
\
|
||||
for (index = 0; index < limit; index++) {\
|
||||
@@ -1025,6 +1026,16 @@
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.flatten` with objects')
|
||||
.add(buildName, '\
|
||||
lodash.flatten(nestedObjects)'
|
||||
)
|
||||
.add(otherName, '\
|
||||
_.flatten(nestedObjects)'
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.flatten` with `shallow`')
|
||||
.add(buildName, '\
|
||||
|
||||
Reference in New Issue
Block a user