~/talk

Your test suite is making too many database calls!

Talkat RailsConf 2022 · 2022-05-17..05-19· [testing, databases]

A one-line change to a single factory speeds a Rails test suite by 15%, because factories were silently creating large object trees. Profiling uses test logs, the factory bot active support notification, SQL-tracker or test-prof factory profiler to count queries and frequency, and simple object-graph diagrams to spot extra associations. Fixes are minimal base factories, inline test setup, avoiding callback-driven creates, and making associations explicit so the suite actually creates only the records needed.

AI-written summary · about

  1. 0:00Intro
  2. 0:44Negative effects of slow tests
  3. 2:00The testing pyramid
  4. 2:27Avoid persisting data
  5. 5:40Locations
  6. 6:01Shared test setup
  7. 8:43Tests with wrong data
  8. 9:46Solution: Inline setup
  9. 15:04Minimal factory
  10. 18:26Broken data
  11. 19:04Updating in setup
  12. 22:09Profiling factories
  13. 23:54Diagramming
  14. 28:10Debugging techniques
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.