es-toolkit/benchmarks/union.bench.ts
Jun 3cc1a03519
chore(*): Add codspeed for benchmark visualization (#75)
* chore: add codspeed

* chore: fix the benchmark file to clearly distinguish between the comparison targets

* chore: fix typo
2024-06-18 10:40:07 +09:00

18 lines
440 B
TypeScript

import { union as unionToolkit } from 'es-toolkit';
import { union as unionLodash } from 'lodash';
import { bench, describe } from 'vitest';
describe('union', () => {
bench('es-toolkit/union', () => {
const array1 = [1, 2, 3];
const array2 = [3, 4, 5];
unionToolkit(array1, array2);
});
bench('lodash/union', () => {
const array1 = [1, 2, 3];
const array2 = [3, 4, 5];
unionLodash(array1, array2);
});
});