← Graph

Use Unlogged Tables to Speed Up Rails Test Suites

takeaway 2 connections

Appending a one-liner to `rails_helper` so RSpec creates all test tables as Postgres UNLOGGED shaved ~3.5 minutes off a bad test suite and ~20 seconds off a good one in Hasiński's client projects, especially where tests write a lot (factory cascades). Trade-off: tables vanish on DB restart, so it's best reserved for CI, not development.

type
recommendation
takeaway Use Unlogged Tables to Speed Up Rails Test Suites
about
Unlogged Tables concept
Advocates using unlogged tables in tests.
takeaway Use Unlogged Tables to Speed Up Rails Test Suites
from_talk
Takeaway from the unlogged-tables section.

Provenance

Read by
1 extraction