mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-28 20:26:33 +03:00
24 lines
624 B
TypeScript
24 lines
624 B
TypeScript
|
import { bench, describe } from 'vitest';
|
||
|
import { fill as fillLodash } from 'lodash';
|
||
|
import { toFilled as toFilledToolkit } from 'es-toolkit';
|
||
|
|
||
|
describe('fill function performance comparison', () => {
|
||
|
bench('es-toolkit/toFilled', () => {
|
||
|
toFilledToolkit([1, 2, 3, 4, 5], '*');
|
||
|
});
|
||
|
|
||
|
bench('lodash/fill', () => {
|
||
|
fillLodash([1, 2, 3, 4, 5], '*');
|
||
|
});
|
||
|
});
|
||
|
|
||
|
describe('fill function performance with custom start and end', () => {
|
||
|
bench('es-toolkit/toFilled', () => {
|
||
|
toFilledToolkit([1, 2, 3, 4, 5], '*', 1, 3);
|
||
|
});
|
||
|
|
||
|
bench('lodash/fill', () => {
|
||
|
fillLodash([1, 2, 3, 4, 5], '*', 1, 3);
|
||
|
});
|
||
|
});
|