mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Optimize _.uniq for large arrays.
Former-commit-id: 6c739aab6bcb8c31f9db9821d6eaf50c9a4fb80b
This commit is contained in:
36
perf/perf.js
36
perf/perf.js
@@ -1657,6 +1657,42 @@
|
||||
)
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 50 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(twentyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(twentyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
suites.push(
|
||||
Benchmark.Suite('`_.uniq` iterating an array of 100 elements')
|
||||
.add(buildName, {
|
||||
'fn': 'lodash.uniq(seventyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
.add(otherName, {
|
||||
'fn': '_.uniq(seventyFiveValues.concat(twentyFiveValues2));',
|
||||
'teardown': 'function multiArrays(){}'
|
||||
})
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
suites.push(
|
||||
|
||||
Reference in New Issue
Block a user