Skip to main content
Most of the time a cloud command is limited by the same things as a local one: how much Lean has to elaborate, and how many cores it can use. Three costs are specific to ProofPod: starting a new sandbox, Lake’s up-to-date check through the sandbox’s filesystem, and the one-time build of a new environment.

Warm sandboxes

After a command finishes, its sandbox stays warm for two minutes. A command that arrives in that window starts in about a second and finds file caches already populated. You are not billed for warm time. A sandbox is reused when the next command in the same workspace asks for the same versions and the same --cpu and --memory. Changing any of those starts a fresh sandbox, which is slower for the first command. If you alternate between two sets of limits, put the larger one in proofpod.toml and use it for everything: unused headroom is free.

Cold starts

A sandbox that has been idle for more than two minutes is shut down. The next command starts a new one, which has to read Mathlib’s files for the first time: the first lake build in a new sandbox spends 15 to 30 seconds reading Mathlib’s build metadata before it compiles anything. Measured on a small project that imports all of Mathlib (Lean 4.36, default 4 cores):

Builds with nothing to rebuild

Before compiling, Lake checks that every module your project depends on is up to date. With Mathlib that is about 18,000 build records, and reading them through the sandbox’s filesystem takes about ten seconds. The same check takes two or three seconds on a local SSD. This overhead is fixed, so it disappears into any build that does real work. For a tight edit-check loop on one file, skip the build:
More cores shorten the check, and limits are free: pp --cpu 16 lake build.

First use of a version

If nobody has used your exact Lean and Mathlib versions before, the first command builds that environment. It takes about five minutes for a Mathlib environment, happens once per version for everyone, and is free. pp envs lists the versions that are already built. See Prebuilt environments.

Summary