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

14 lines
382 B
TypeScript
Raw Normal View History

2024-04-25 14:56:13 +03:00
import { bench, describe } from 'vitest';
import { takeWhile as takeWhileToolkit } from 'es-toolkit';
import { takeWhile as takeWhileLodash } from 'lodash';
describe('takeWhile', () => {
bench('es-toolkit/takeWhile', () => {
2024-04-25 14:56:13 +03:00
takeWhileToolkit([5, 4, 3, 2, 1], n => n < 4);
});
2024-04-25 14:56:13 +03:00
bench('lodash/takeWhile', () => {
2024-04-25 14:56:13 +03:00
takeWhileLodash([5, 4, 3, 2, 1], n => n < 4);
});
});