Performance: Why real-time matters
HIGH IMPACT
Real-time features impact how quickly users see updates and interact with the page, affecting responsiveness and perceived speed.
Use WebSocket connections or Server-Sent Events to push only changed data to the client, updating DOM elements selectively.Use frequent full page reloads or polling every second with Flask routes returning full HTML pages.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full page reload polling | High (entire DOM replaced) | Multiple per reload | High (full repaint) | [X] Bad |
| WebSocket partial updates | Low (targeted nodes only) | Single per update | Low (partial repaint) | [OK] Good |