es-toolkit/benchmarks/performance/set.bench.ts
Dayong Lee bcc3e924fd
chore: move some of files to performance folder and change path of importing correctly (#375)
* Remove duplicated zipObjectDeep bench

* set: Move and import from compat

* cloneDeep: Move to benchmarks folder

* startCase: Move to benchmarks folder
2024-08-11 15:21:14 +09:00

20 lines
600 B
TypeScript

import { describe, bench } from 'vitest';
import { set as setToolkitCompat } from 'es-toolkit/compat';
import { set as lodashSet } from 'lodash';
describe('set', () => {
bench('es-toolkit/set-1', () => {
setToolkitCompat({}, 'a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z', 1);
});
bench('es-toolkit/set-2', () => {
setToolkitCompat({}, 'a[0][1][2][3][4][5][6]', 1);
});
bench('lodash/set-1', () => {
lodashSet({}, 'a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z', 1);
});
bench('lodash/set-2', () => {
lodashSet({}, 'a[0][1][2][3][4][5][6]', 1);
});
});