Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 2 min read

I almost rewrote my backend in Rust to speed up CI. The data said no.

I build a product mostly alone, with AI coding agents opening hundreds of pull requests a week. Once agents write the code, writing stops being the slow part. Proving a change is safe to merge becomes the slow part. Our

I almost rewrote my backend in Rust to speed up CI. The data said no.

I build a product mostly alone, with AI coding agents opening hundreds of pull requests a week. Once agents write the code, writing stops being the slow part. Proving a change is safe to merge becomes the slow part.

Our tests were fine: 185,280 test results in 7 days, 0.1% failing, p95 test duration 17.3 s.

CI test analytics for 7 days: 185,280 results, 0.1% failure rate, top 10 slowest test files

Merging was not fine. The slowest 10% of PRs took more than 10.6 hours from open to merge.

The tempting fix

My first instinct: move the backend to Rust and keep Next.js for the UI. It is a reasonable idea when CI feels slow. Before answering, I traced 57 merged PRs from open to merge, using the PR timelines and the CI run logs.

What the trace showed

  • The checks themselves (lint, typecheck, guards) took about 5 minutes.
  • Build and language were under 5% of total lead time.
  • The time split was: 55% waiting for the PR to be ready, 33% waiting for the merge queue to pick it up, 12% actually in the queue.

The slow tail had three causes, all of them waiting:

  1. A label nobody applied. Green PRs waited for a "ship it" label before boarding the merge queue. That was 11 of the 20 PRs that waited past 6 hours.
  2. Batches ejected for paperwork. The merge queue re-checked the batch description, which was missing lines each member PR carried, so good PRs got kicked out.
  3. Bisecting that threw away work. When a batch failed, both halves were opened at once. The first to merge made the other out of date, and it was closed.

A Rust rewrite would have sped up the 5%.

What I changed

  • PRs board the merge queue on their own after 30 quiet minutes. No label wait.
  • The batch description carries every member's required lines.
  • A failing batch is split one half at a time; the other half waits instead of being closed.
  • An alert fires every 2 hours if any PR has waited more than 6 hours, so a stuck PR gets an owner instead of silence.

Result

The slowest 10% went from 10.6 h to 5.3 h (7-day windows). Median is 1.4 h. No new hardware, no rewrite.

The lesson

When agents write the code, the merge pipeline becomes your product. Measure where the waiting is before you buy speed. Most of it is not in the build.

If your team's agents produce PRs faster than you can safely merge them, I help set up the pipeline that keeps up. Reach out.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.