Struo

A field guide to productivity in the age of agents

You might not need more compute

Use the compute you have smarter first.

Agents write code faster than most teams can build and test it. When CI slows down, the usual reaction is to buy bigger runners and more cores, or to add a cache step. We've worked on build infrastructure at Tuist for years, and we keep seeing teams pay for compute their builds and tests can't use. These are the guidelines we'd follow, in the order we'd follow them.

More cores, same wait

You might think A machine with twice the cores builds twice as fast.

A build is a graph, not a queue. Its wall time is bounded by the longest chain of work that has to happen in order, the critical path. Extra cores only help when the graph has enough independent work to keep them busy.

Many graphs don't have it. One large module that everything depends on, a test target that bundles the whole suite, or a CI script that runs steps one after another leaves most of the machine idle while a single chain finishes. You pay for every core and keep two or three of them busy.

core 1core 2core 3core 4core 5core 6core 7core 8 start build finished
The highlighted chain is the critical path. About a fifth of this machine does any work. A bigger machine adds more empty rows.

Making a build faster usually means changing the shape of the graph: splitting the module everyone waits on, removing dependencies that exist by accident, and running independent tests apart.

A single build won't tell you where to start. You need to see the graph as it changes over time: which modules change in almost every commit, how many others depend on them, and how much work each change sets off downstream. A hot module near the root of the graph puts every commit on the critical path, and more cores won't change that.

Getting this data means understanding each build toolchain, which is expensive. Most infrastructure vendors don't invest in it, because selling more and faster compute is easier and it's what they get paid for.

The meter isn't on your side

You might think Your compute provider will tell you when you're wasting compute.

Most runner and sandbox providers charge by the minute and by the size of the machine. Helping you use fewer minutes on smaller machines takes work on their side and lowers what they bill you, so the product they put in front of you is a faster machine.

The insight that would shrink the bill lives above the machine, in the build graph: which actions ran, which could have run in parallel, and why a cache missed. A compute vendor sees jobs and minutes, so that's what its dashboards show you.

This matters more with agents. A person might run the test suite a few times a day; an agent can run it twenty times an hour, and the waste in each run adds up with it.

One changed file, one rebuilt world

You might think A cache hit or miss is all there is to know.

Most CI caches store a directory as one archive under one key, often the hash of a lockfile. Change anything the key covers and the whole archive is gone. Change something it doesn't cover and you restore stale results.

A content-addressed cache stores each action's result under the hash of its exact inputs. When a file changes, only the actions that read it, and the actions that depend on them, run again. Everything else is still a hit.

One archive, one key

24 of 24 rebuilt

One key per action

4 of 24 rebuilt

The same one-file change under two cache designs. Each square is an action in the build.

Content addressing is also what makes a cache safe to share. Two machines that see the same inputs get the same key, whether they're laptops, CI runners, or agent sandboxes. The next question is where that shared cache lives.

A cache is a network problem

You might think Adding a cache step to CI always makes it faster.

A cache only pays off when downloading a result is faster than producing it again. Many CI runner providers back their cache with object storage that the runner reaches over the public internet, sometimes in another region. Every job pulls archives down at the start and pushes them back up at the end.

With a few gigabytes of dependencies and a slow link, restoring the cache can take longer than the build it replaces. You still see a green "cache hit" in the logs, so nobody notices. Try it with your own numbers:

No cache 1m 30s
With cache 1m 42s

The cache costs about 12s per job. Skipping it would be faster.

A hit downloads the cache. A miss rebuilds and uploads it again. Compression, request latency, and partial restores are left out, and they rarely help. The presets are rough orders of magnitude; measure your own.

The fix is locality. Put the cache next to the compute, in the same region or the same network, and transfer only what the job needs instead of the whole archive.

That gets harder when the team is spread across the world. A company might run its CI in US East while its engineers, and the agents working for them, sit in Berlin and Tokyo. The cache lives next to the runners, so CI gets fast hits and everyone else reaches across an ocean for every artifact. Often they give up on the shared cache, and their laptops and agents build from scratch.

CI + cache US East
~1 ms
Berlin to cache
~90 ms
Tokyo to cache
~150 ms
The cache sits next to CI. Every request from Berlin or Tokyo crosses an ocean first, and a build makes thousands of them. Drag the globe to turn it. Round trips are typical figures, not measurements.

Few teams have cache infrastructure that's close to everyone, replicated across regions and kept consistent. Runner providers optimize for their own runners, so the developers and agents who make most of the changes end up with the slowest cache, or none.

Every agent starts cold

You might think Agents speed up the work, so the build matters less.

A developer builds on a warm laptop with yesterday's results still on disk. An agent usually starts in a fresh sandbox with nothing. Run ten agents on ten tasks and you get ten cold builds of the same dependencies, in parallel, every time.

Agents also build and test far more often than people do. They try a change, run the tests, read the failure, and try again. The time a build takes is the time between those tries, so it sets how many iterations an agent gets in an hour and how much it costs to get a working change.

A cache shared by developers, agents, and CI turns ten cold builds into one build and nine restores.

Not every test needs to run

You might think Once the build is fast, the job is done.

Reusing work only goes so far; some work shouldn't happen at all. In many projects the tests take longer than the build. The graph that tells a build what to recompile also tells you which tests a change can affect, and a change to a settings screen doesn't need the networking tests. Running only the affected tests on each commit can save more than any cache.

Flaky tests cost compute too. A test that fails one run in fifty gets retried, and a retry often reruns the whole job. You pay for the reruns, and for the time people spend working out whether a red build is real.

With agents the cost goes up. An agent can't tell a flaky failure from a real one. It sees a red test, assumes its change broke something, and starts fixing code that was fine. Each flaky test costs a few iterations of an agent that runs the suite many times an hour.

Both problems need history: which tests a change affected, which ones fail without a related change, and how often. A runner that sees one job at a time can't answer that.

Remote execution moves bytes, not only work

You might think Running the build somewhere else makes it free.

What's left after reusing and skipping work can be spread out. Remote execution runs actions across many machines, so the wide parts of a graph aren't limited to the cores of one. Each action still needs its inputs on the worker and its outputs back. If the workers sit far from the cache, or actions declare more inputs than they read, the time saved computing is spent transferring.

It works best when actions say exactly what they read and write, when workers sit next to the cache, and when the graph is wide enough to use them. That's why the shape of the graph from the first guideline matters here too.

Keep the build you already have

You might think Remote caching and execution means adopting Bazel or Buck.

Bazel and Buck brought Google's and Meta's approach to the rest of the industry, and they're excellent at it. They also ask you to describe your whole project again in their own build files, and to keep a team that maintains that second description as the toolchains underneath move on.

For most teams that second description is the expensive part, and it's why they never adopted remote caching or execution. The information a cache needs, which inputs produce which outputs, is already in the project's own manifests: a Cargo.toml, an Xcode project, a Package.swift, a mix.exs.

Struo reads those manifests and derives the build graph from them, so you keep your project as it is and get caching and remote execution underneath. Native tools are moving in the same direction, with compilation caching in Xcode 26 and a cross-workspace cache for Cargo. Either way, you keep the build you already have.

Before you buy more compute

  1. Find the critical path of your slowest pipeline, and the modules that change most.
  2. Measure how busy the machine is across the whole build, not at its peak.
  3. Count how often the same inputs get built by agents, developers, and CI.
  4. Time a cache restore next to a cold run of the same step, from every region you work in.
  5. List the tests each commit runs without needing to, and the ones that flake.

Struo is our answer to most of these: content-addressed caching and remote execution for the projects you already have, with any provider, including your own.

Get started Why we built Struo