"매 여러 update 매 한 번 처리". Batching은 multiple state changes를 single update cycle로 묶어 redundant rendering/computation을 줄이는 reactive UI 의 core optimization. 2026 모든 mainstream framework (React, Vue, Svelte, Solid) 에서 default behavior.
매 핵심
매 batching 이 필요한 이유
매 setState 매 separate render → DOM mutation N times.
매 batching → microtask/tick 까지 모아 single commit → DOM mutation 1 time.
functionupdate() {setA(1);setB(2);setC(3);// 매 single render
}
Vue 3 batched watcher
import{ref,watchEffect,nextTick}from'vue';constcount=ref(0);watchEffect(()=>console.log(count.value));count.value++;count.value++;count.value++;awaitnextTick();// 매 console.log 매 한 번
Solid explicit batch
import{batch,createSignal}from'solid-js';const[a,setA]=createSignal(0);const[b,setB]=createSignal(0);batch(()=>{setA(1);setB(2);});// 매 single update