MCPcopy
hub / github.com/vuejs/core / benchEffectCreate

Function benchEffectCreate

packages/reactivity/__benchmarks__/effect.bench.ts:15–27  ·  view source on GitHub ↗
(size: number)

Source from the content-addressed store, hash-verified

13 }
14
15 function benchEffectCreate(size: number) {
16 bench(`create an effect that tracks ${size} refs`, () => {
17 const refs: Ref[] = []
18 for (let i = 0; i < size; i++) {
19 refs.push(ref(i))
20 }
21 effect(() => {
22 for (let i = 0; i < size; i++) {
23 refs[i].value
24 }
25 })
26 })
27 }
28
29 benchEffectCreate(1)
30 benchEffectCreate(10)

Callers 1

effect.bench.tsFile · 0.85

Calls 3

effectFunction · 0.85
pushMethod · 0.65
refFunction · 0.50

Tested by

no test coverage detected