es-toolkit/benchmarks/shuffle.bench.ts
Minsoo Kim cf65b2c601
style(*): Setup prettier and apply formatting (#24)
* chore: add prettierrc

* chore: apply format with prettier config

* chore: eslint error fix
2024-06-04 17:19:26 +09:00

16 lines
374 B
TypeScript

import { bench, describe } from 'vitest';
import { shuffle as shuffleToolkit } from 'es-toolkit';
import { shuffle as shuffleLodash } from 'lodash';
describe('shuffle', () => {
bench('es-toolkit', () => {
const array = [1, 2, 3, 4, 5];
shuffleToolkit(array);
});
bench('lodash', () => {
const array = [1, 2, 3, 4, 5];
shuffleLodash(array);
});
});