es-toolkit/benchmarks/performance/xorBy.bench.ts
2024-07-17 11:47:39 +09:00

16 lines
476 B
TypeScript

import { bench, describe } from 'vitest';
import { xorBy as xorByToolkit } from 'es-toolkit';
import { xorBy as xorByLodash } from 'lodash';
describe('xorBy', () => {
bench('es-toolkit/xorBy', () => {
const idMapper = obj => obj.id;
xorByToolkit([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
});
bench('lodash/xorBy', () => {
const idMapper = obj => obj.id;
xorByLodash([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
});
});