mirror of
https://github.com/toss/es-toolkit.git
synced 2024-12-01 10:45:08 +03:00
20 lines
547 B
TypeScript
20 lines
547 B
TypeScript
|
import { describe, bench } from 'vitest';
|
||
|
import { set } from 'es-toolkit';
|
||
|
import { set as lodashSet } from 'lodash';
|
||
|
|
||
|
describe('set', () => {
|
||
|
bench('es-toolkit/set-1', () => {
|
||
|
set({}, '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', () => {
|
||
|
set({}, '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);
|
||
|
});
|
||
|
});
|