es-toolkit/benchmarks/xorBy.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

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);
});
});