Performance: First Svelte component
MEDIUM IMPACT
This affects the initial page load speed and time to interactive by controlling how much JavaScript and DOM nodes are created.
<script> let count = 0; </script> <button on:click={() => count++}> Clicked {count} times </button>
<script> let count = 0; // Unused heavy library import import _ from 'lodash'; </script> <button on:click={() => count++}> Clicked {count} times </button>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Simple component without heavy imports | Minimal DOM nodes | 1 reflow on initial render | Low paint cost | [OK] Good |
| Component with large unused library import | Same DOM nodes | 1 reflow on initial render | Low paint cost | [X] Bad |