es-toolkit/benchmarks/union.bench.ts
Minsoo Kim cf65b2c601
style(*): Setup prettier and apply formatting (#24)
* chore: add prettierrc

* chore: apply format with prettier config

* chore: eslint error fix
2024-06-04 17:19:26 +09:00

18 lines
428 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', () => {
const array1 = [1, 2, 3];
const array2 = [3, 4, 5];
unionToolkit(array1, array2);
});
bench('lodash', () => {
const array1 = [1, 2, 3];
const array2 = [3, 4, 5];
unionLodash(array1, array2);
});
});