Ben Halpern describes how Forem organized recurring performance work on DEV in Our Looping Factory Cut DEV Page Load Time by 75% and Counting. His account traces the move from interactive coding sessions to scheduled jobs that use production measurements to select work.
Give each job a measured problem
Halpern says early jobs looked through Ruby files for plausible improvements and rarely found changes that moved the performance graphs. The team added Better Stack traces and a read-only PostgreSQL gateway to the information available before each run, with a privacy guard around the data. The resulting workflow could identify endpoints with high query costs and examine evidence such as sequential scans before proposing a patch.
Scheduled work was divided by task. One loop handled ActiveRecord, caching and view performance. Another used timings from RSpec shards to look for expensive test setup. A loop for moving selected Ruby paths into Rust was limited to one open pull request and used differential tests to compare behavior. Halpern also describes separate review and merge steps for eligible changes that passed CI.
Where the time savings appeared
Halpern reports that average time inside Rails fell from about 70 ms to 16 ms. He gives separate figures for database time, which went from 39 ms to under 12 ms, and view rendering, which fell from 12 ms to 2.6 ms. Those figures describe the DEV system during the period he wrote about. The article covers multiple changes over that period, including engineering work Halpern drove directly, so it leaves the contribution of any single change open.
The case raises a practical question for teams with similar maintenance queues. If a scheduled job can propose a query change, which evidence should its pull request carry so a reviewer can judge the expected benefit? Forem's example suggests starting with the endpoint, the observed cost and the specific database behavior that motivated the patch.