Performance: First Rails application
MEDIUM IMPACT
This affects the initial page load speed and server response time when serving the first page of a Rails app.
class HomeController < ApplicationController def index @users = User.limit(10) end end # View uses simple markup and fragment caching for partials
class HomeController < ApplicationController def index @users = User.all end end # View renders all users with heavy partials and no caching
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Render all database records with heavy partials | High (many nodes) | Multiple reflows due to complex DOM | High paint cost | [X] Bad |
| Limit records and use fragment caching | Low (few nodes) | Single reflow | Low paint cost | [OK] Good |