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

14 lines
452 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { xorWith as xorWithToolkit } from 'es-toolkit';
import { xorWith as xorWithLodash } from 'lodash';
import { bench, describe } from 'vitest';
2024-04-25 14:56:13 +03:00
describe('xorWith', () => {
bench('es-toolkit/xorWith', () => {
2024-04-25 14:56:13 +03:00
xorWithToolkit([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], (x, y) => x.id === y.id);
});
2024-04-25 14:56:13 +03:00
bench('lodash/xorWith', () => {
2024-04-25 14:56:13 +03:00
xorWithLodash([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], (x, y) => x.id === y.id);
});
2024-04-25 14:56:13 +03:00
});