Why updating reactant arrays upon every single WebSocket packet degrades CPU cycles and how frame buffers fix it.
Each incoming token from a local LM Studio server is delivered as a singular HTTP chunk. If an instance attempts to update state upon each tiny chunk, it fills the microtask queue, leaving zero processing power for mouse movements or drawer toggles.
Instead, we pool incoming characters inside a simple JS queue array. A requestAnimationFrame loop runs every 16.7ms, pulling the current buffer packet and flushing it to the DOM in a single cohesive paint instruction, preserving the UI thread for user input.