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', () => {
|
2024-06-18 04:40:07 +03:00
|
|
|
bench('es-toolkit/shuffle', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
const array = [1, 2, 3, 4, 5];
|
|
|
|
shuffleToolkit(array);
|
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/shuffle', () => {
|
2024-04-25 14:56:13 +03:00
|
|
|
const array = [1, 2, 3, 4, 5];
|
|
|
|
shuffleLodash(array);
|
2024-06-04 11:19:26 +03:00
|
|
|
});
|
|
|
|
});
|