Skip to content
NewSee how fast an edit goes live on this site
Halftone

EngineeringPerformance

Why we moved cold starts to the edge, part 2

What changed when we stopped guessing and started measuring every step.

Eli Tanaka
Published 3 min read

Latency at the median improved, but the tail is what people feel. Our p95 dropped from 4.1 seconds to 900 milliseconds, and support tickets about slowness fell by more than half. This post covers what we changed, why, and what it means for you.

#Rolling it out

The fix was less clever than we expected. We cached what never changes, skipped what had not changed, and stopped doing work in series that could happen side by side.

None of this needed a new framework. It needed a clear owner, a dashboard people actually looked at, and permission to delete code that no longer earned its keep.

For most of last year, a full build took eleven minutes. Nobody decided that was acceptable; it simply grew there, one dependency and one test suite at a time, until waiting became part of the job.

StepBeforeAfter
Install94s12s
Build41s7s
Deploy18s4s

#What changed

The part we underestimated was rollback. A faster pipeline is only better if you can undo it just as fast, so every deploy now keeps the previous version warm and one click away.

Caching is easy to add and hard to trust. The rule we settled on is simple: a cache key must include everything that can change the output, and nothing that cannot.

We started by measuring instead of guessing. Every step got a timer, every run wrote its numbers to a table, and within a week the picture was clear: most of the time went to setup, not to the work itself.

#The details

We kept the old path running next to the new one for two weeks and compared outputs byte for byte. Most differences were harmless. Three were real bugs that the old path had been hiding for years.

Latency at the median improved, but the tail is what people feel. Our p95 dropped from 4.1 seconds to 900 milliseconds, and support tickets about slowness fell by more than half.

The fix was less clever than we expected. We cached what never changes, skipped what had not changed, and stopped doing work in series that could happen side by side.

ts
const key = `${route}:${hash(content)}:${hash(template)}`;
const hit = await cache.match(key);
if (hit) return hit;

#What we measured

None of this needed a new framework. It needed a clear owner, a dashboard people actually looked at, and permission to delete code that no longer earned its keep.

For most of last year, a full build took eleven minutes. Nobody decided that was acceptable; it simply grew there, one dependency and one test suite at a time, until waiting became part of the job.

The part we underestimated was rollback. A faster pipeline is only better if you can undo it just as fast, so every deploy now keeps the previous version warm and one click away.

StepBeforeAfter
Install94s12s
Build41s7s
Deploy18s4s

#Results

Caching is easy to add and hard to trust. The rule we settled on is simple: a cache key must include everything that can change the output, and nothing that cannot.

We started by measuring instead of guessing. Every step got a timer, every run wrote its numbers to a table, and within a week the picture was clear: most of the time went to setup, not to the work itself.

We kept the old path running next to the new one for two weeks and compared outputs byte for byte. Most differences were harmless. Three were real bugs that the old path had been hiding for years.

  • Keep the previous version one click away
  • Cache what never changes
  • Skip what has not changed
  • Run independent steps in parallel

#What we would do differently

Latency at the median improved, but the tail is what people feel. Our p95 dropped from 4.1 seconds to 900 milliseconds, and support tickets about slowness fell by more than half.

The fix was less clever than we expected. We cached what never changes, skipped what had not changed, and stopped doing work in series that could happen side by side.

None of this needed a new framework. It needed a clear owner, a dashboard people actually looked at, and permission to delete code that no longer earned its keep.