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

16 lines
390 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { bench, describe } from 'vitest';
import { shuffle as shuffleToolkit } from 'es-toolkit';
import { shuffle as shuffleLodash } from 'lodash';
describe('shuffle', () => {
bench('es-toolkit/shuffle', () => {
2024-04-25 14:56:13 +03:00
const array = [1, 2, 3, 4, 5];
shuffleToolkit(array);
});
2024-04-25 14:56:13 +03:00
bench('lodash/shuffle', () => {
2024-04-25 14:56:13 +03:00
const array = [1, 2, 3, 4, 5];
shuffleLodash(array);
});
});