Performance: Why forms drive user interaction
MEDIUM IMPACT
Forms impact how quickly users can interact with a page and how smoothly the page responds to input.
form_with url: '/submit', method: :post, local: true, data: { turbo: false } do |form| = form.text_field :name = form.submit 'Send' end # Submits synchronously with minimal DOM updates
form_with url: '/submit', method: :post, local: false do |form| = form.text_field :name = form.submit 'Send' end # Submits via AJAX but triggers full page re-render on response
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| AJAX form with full page re-render | High (many nodes updated) | Multiple reflows | High paint cost | [X] Bad |
| Synchronous form with minimal DOM update | Low (only form elements) | Single reflow | Low paint cost | [OK] Good |