Performance: Input bindings (bind:value)
MEDIUM IMPACT
This affects interaction responsiveness and rendering speed when users type or change input fields.
<input type="text" bind:value={value} /> <script> let value = ''; </script>
<input type="text" on:input={handleInput} /> <script> let value = ''; function handleInput(event) { value = event.target.value; } </script>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Manual on:input handler | 1 per input | 1 per keystroke | Moderate | [!] OK |
| bind:value two-way binding | 1 per input | 1 per keystroke | Low to moderate | [OK] Good |
| bind:value on many inputs without batching | Many | Many per keystroke | High | [X] Bad |
| bind:value with debounced updates | Many | Few | Low | [OK] Good |