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', () => {
|
2024-06-18 04:40:07 +03:00
|
|
|
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-06-04 11:19:26 +03:00
|
|
|
});
|
2024-04-25 14:56:13 +03:00
|
|
|
|
2024-06-18 04:40:07 +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-06-04 11:19:26 +03:00
|
|
|
});
|
2024-04-25 14:56:13 +03:00
|
|
|
});
|