~/talk

Laravel Eloquent Performance

Talkat Laracon Online Winter 2020 · on Wednesday, 2020-02-26· [laravel, databases]
speakerdeck:reinink
slides:none on file

Demo app has 250 wants, 6,500 comments and 30,000 votes and uses Laravel tools like Debugbar with a models collector. Techniques shown: replace loading 250 models for a dashboard with one query using conditional aggregates, build a dynamic relationship that returns last_comment_id via a select subquery and eager load it, and avoid N+1 by calling setRelation to attach already-loaded models. Examples reduce queries from dozens (83, 161) down to about five or six and cut hydrated models and memory.

AI-written summary · about

  1. 0:00Introduction
  2. 1:03Eloquent performance overview
  3. 6:17Laravel debug bar setup
  4. 11:08Dashboard status totals
  5. 19:09Comment links and author badges
  6. 33:52Circular relationships solution
  7. 36:18Last comment on dashboard
  8. 47:33Column sorting techniques
  9. 1:03:21Summary and resources
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.