Performance: Pagination
MEDIUM IMPACT
Pagination affects page load speed by limiting the amount of data loaded and rendered at once, improving initial load and interaction responsiveness.
<?php $items = Item::paginate(15); return view('items.index', ['items' => $items]);
<?php $items = Item::all(); return view('items.index', ['items' => $items]);
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Load all data at once | High (many nodes) | Multiple reflows due to large DOM | High paint cost | [X] Bad |
| Use Laravel paginate() | Low (limited nodes) | Single reflow per page | Low paint cost | [OK] Good |