mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-29 04:34:01 +03:00
24 lines
582 B
TypeScript
24 lines
582 B
TypeScript
import { bench, describe } from 'vitest';
|
|
import { fill as fillToolkit } from 'es-toolkit';
|
|
import { fill as fillLodash } from 'lodash';
|
|
|
|
describe('fill function performance comparison', () => {
|
|
bench('es-toolkit/fill', () => {
|
|
fillToolkit([1, 2, 3], 10);
|
|
});
|
|
|
|
bench('lodash/fill', () => {
|
|
fillLodash([1, 2, 3], 10);
|
|
});
|
|
});
|
|
|
|
describe('fill function performance with custom start and end', () => {
|
|
bench('es-toolkit/fill', () => {
|
|
fillToolkit([4, 6, 8, 10], '*', 1, 3);
|
|
});
|
|
|
|
bench('lodash/fill', () => {
|
|
fillLodash([4, 6, 8, 10], '*', 1, 3);
|
|
});
|
|
});
|