es-toolkit/benchmarks/partition.bench.ts

14 lines
376 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { bench, describe } from 'vitest';
import { partition as partitionToolkit } from 'es-toolkit';
import { partition as partitionLodash } from 'lodash';
describe('partition', () => {
bench('es-toolkit/partition', () => {
2024-04-25 14:56:13 +03:00
partitionToolkit([1, 2, 3, 4, 5], x => x < 3);
});
2024-04-25 14:56:13 +03:00
bench('lodash/partition', () => {
2024-04-25 14:56:13 +03:00
partitionLodash([1, 2, 3], x => x < 3);
});
});