es-toolkit/benchmarks/performance/pick.bench.ts
D-Sketon 82845fb08b
bench: fix bench (#558)
Co-authored-by: Sojin Park <raon0211@toss.im>
2024-09-23 15:30:34 +09:00

19 lines
546 B
TypeScript

import { bench, describe } from 'vitest';
import { pick as pickToolkit } from 'es-toolkit';
import { pick as pickCompatToolkit } from 'es-toolkit/compat';
import { pick as pickLodash } from 'lodash';
describe('pick', () => {
bench('es-toolkit/pick', () => {
pickToolkit({ foo: 1, bar: 2, baz: 3 }, ['foo', 'bar']);
});
bench('es-toolkit/compat/pick', () => {
pickCompatToolkit({ foo: 1, bar: 2, baz: 3 }, ['foo', 'bar']);
});
bench('lodash/pick', () => {
pickLodash({ foo: 1, bar: 2, baz: 3 }, ['foo', 'bar']);
});
});