Comparing direct DOM binding updates vs Virtual DOM diffing
Tip: Set batch size to "Infinity" and flush delay to "microtask" for fair comparison with React's automatic batching. Use batch size "1" with "0 (synchronous)" for immediate updates (like drag-and-drop scenarios).
BosatsuUI uses compile-time static analysis to extract
statePath -> DOMProperty bindings. When state changes:
element.property = value directly (O(1) per binding)React approach: Create new virtual DOM tree -> Diff against old tree -> Generate patches -> Apply patches. This is O(n) where n is component tree size.
With batching: BosatsuUI collects updates in a Map (last-write-wins monoid), then applies them all at once. This gives React 18-style automatic batching while skipping VDOM diffing entirely.