Forge CI Gets 4x Faster After Cloudflare Overhaul

Chart of Forge CI run time falling from 24 minutes to 6 minutes

A full Forge CI run for Smol now takes 6 minutes, down from 24. Per-job setup fell from 80 to 100 seconds to about 13. Smol, the team behind the Git host and CI platform Forge, says the gains came from stopping repeated and distant work rather than from new algorithms.

Forge is a GitHub, Actions and Vercel clone built mostly by agents and run entirely on Cloudflare. Git objects sit in R2, metadata in D1, and CI and native git run in Containers. The team profiled the system end to end this week, and the Forge CI numbers above are measured. A typical git push, now at 34 seconds, is projected to drop to about 1 second, though most of that is still an estimate.

Why a 71-object push took 34 seconds

One push to a Smol repository carried 71 objects and 5 MiB. The server spent 34 seconds on it, and 23 of those went to publishing objects out of the sandbox into storage. Each object cost one sandbox read, one R2 head request and one R2 put, handled four at a time. That came to about 1.3 seconds per object.

Cost followed object count, not pack size. A 13-object push earlier the same day spent 43 seconds on the same step.

The fixes went out in sequence:

  • Small objects now leave the sandbox in one tar archive per batch, then go to R2 as 32 conditional writes in flight. Publishing dropped to about 240 ms per object, roughly 5x better.
  • Packs up to 8 MiB are decoded and checked inside a Worker, so most pushes never boot a container. A 5 MB, 62-object pack took about 0.12 seconds in a local test.
  • Permission, deletion and protected-branch checks now run in parallel, saving about 1.2 seconds of round trips from Singapore.
  • Verified tokens are cached for 15 seconds, which avoids a repeated 0.6 second lookup on each of a push’s 2 to 3 requests.

The in-Worker path only accepts what it is sure about. It runs a subset of git fsck checks, and anything doubtful, such as .gitmodules, non-ASCII paths or oversized packs, falls back to the old native route. Pulls got a similar treatment: a D1 commit index lets one recursive query return up to 2,000 ancestors, instead of one R2 read per commit. A 152-commit pull had sat on its object-graph walk for 62 seconds.

Table mapping each speedup to the Cloudflare feature behind it: Workers, R2 conditional writes, D1, Containers, container snapshots, Smart Placement and service bindings
Image: SmolForge

How CI went from 24 minutes to 6

The first 18 minutes came off in the usual ways. The team split one container into eight parallel jobs, checkpointed the checkout, added a shared run queue and moved the build into the job that needs it. That gave a warm run of 6 minutes, then a floor: each job still spent about 45 seconds before its first step, plus 1 to 1.7 minutes on setup.

The answer was a per-repository container image. Smol’s apt packages, FFmpeg, pnpm, Playwright’s Chromium and WebKit, and its installed dependency tree are now baked in. On the production image, start took 1 second and setup 9 seconds, against 80 to 100 seconds before. The median pnpm install fell to 7 seconds from 30 to 85.

Where a 34 second push went: 23 of 34 seconds publishing objects
Image: SmolForge

The snapshot lane that made things slower

Lockfiles change daily, so baked images go stale. The team added a lane built on Cloudflare container snapshots, where one trusted run installs dependencies and later runs restore them. Restores take under 0.6 seconds once a host has the snapshot cached, and 17 to 45 seconds on a new host.

Turning it on made CI worse. Smol was moved off its baked image, pnpm install climbed from 7 to 59 seconds, and a failed snapshot build used up the day’s build budget. Failed builds no longer count against the limit, repos keep their own image inside the lane, and the lane is off for Smol until it runs green for a day.

Before and after: small pushes skip the container
Image: SmolForge

Seven milliseconds of work, 2.6 seconds of waiting

Authenticated page loads from Singapore showed a Worker CPU p50 of 7.4 ms against a wall-clock p50 of 2.6 seconds. The Worker sat in Singapore while the database sat in Oregon, so each page made 6 to 15 sequential D1 round trips across the Pacific.

Smart Placement now runs the API and repository Workers near the data. The edge Worker that serves HTML stays local and forwards API calls over a service binding, so a request crosses the ocean once. The catch is that requests barely touching D1 now pay that one hop too.

What Smol is changing next

The Smart Placement change merged this morning, and before-and-after p50 numbers will follow once Cloudflare moves the Workers. Most of the push speedups are still projections from individual pull requests, with live progress lines on each push expected to show real times. D1 read replication is the next candidate, but it needs every query to go through the Sessions API and could let a fetch right after a push briefly see the old branch tip. Smol calls that a project, not a config change.

Source: SmolForge

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.