es-toolkit/benchmarks/performance/xorBy.bench.ts

16 lines
476 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { bench, describe } from 'vitest';
import { xorBy as xorByToolkit } from 'es-toolkit';
import { xorBy as xorByLodash } from 'lodash';
describe('xorBy', () => {
bench('es-toolkit/xorBy', () => {
2024-04-25 14:56:13 +03:00
const idMapper = obj => obj.id;
xorByToolkit([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
});
2024-04-25 14:56:13 +03:00
bench('lodash/xorBy', () => {
2024-04-25 14:56:13 +03:00
const idMapper = obj => obj.id;
xorByLodash([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);
});
2024-04-25 14:56:13 +03:00
});