The engineering tradeoff between security and speed, and the snapshot technique that resolved it.
Every time a user asks a coding assistant to run a script or triggers a serverless function, a small but consequential negotiation takes place inside the machine. The computer must do two things at once: run the code as fast as possible, and make absolutely sure that code cannot touch anything it should not. Those two goals pull against each other with surprising force, and resolving the tension between them has become one of the defining engineering problems of modern computing infrastructure.
Systems researchers call it the latency-isolation tradeoff. Getting it wrong means either slow systems or insecure ones. Getting it right has required rethinking a basic assumption about how computers start.
When a computer runs untrusted code, it constructs a kind of temporary prison around it. On Linux, the two fundamental tools for building that prison are namespaces and control groups. Namespaces give a process its own private view of the system, its own process IDs, filesystem, and network interfaces, as if it were the only thing running on the machine. Control groups cap what it is allowed to consume. Creating and destroying these structures for every short-lived task carries a measurable cost. Network namespaces involve global locks inside the kernel that serialize creation across processor cores. Filesystem layers must be assembled. Seccomp filters, which restrict which system calls a process may make, must be compiled for each instance. Each cost is small, but the stack of them becomes a design constraint that shapes every architectural decision downstream.
The trouble with containers is that a process escaping one is still on the host machine. It has broken out of the view restrictions but not out of the underlying system. Hardware virtualization draws a harder line. AWS built Firecracker, a minimalist virtual machine monitor written in Rust, to give each workload its own guest kernel behind a hardware boundary rather than just a process boundary. A process escaping a microVM has to defeat the hypervisor first, which is a fundamentally different class of problem. That stronger guarantee costs roughly 125 milliseconds to boot under ideal conditions, with customer code initialization adding seconds on top. For an AI agent spinning up a fresh isolated environment for every subtask in a reasoning chain, those milliseconds compound into something users notice and that costs real money.
The most intuitive solution to the cold start problem is to stop letting things go cold. A warm pool pre-builds execution environments and keeps them idling, ready to receive work. When a request arrives it lands on an already-running environment and begins immediately, with no boot sequence, no namespace setup, no filter compilation. Latency drops from hundreds of milliseconds to single digits.
The flaw is structural. A warm pool is a bet on predictable traffic. AWS Provisioned Concurrency, the productized version of this idea, breaks even against standard on-demand billing at around 60 percent utilization. Below that threshold you are paying more for the pool than the latency savings justify, and the moments when a warm pool is most needed, during sudden traffic bursts, are exactly the moments when provisioned capacity runs out and cold starts return. Warm pools treat the symptom without addressing the cause. The initialization work still has to happen somewhere; you have only moved it earlier in time and agreed to pay for it continuously.
The more radical approach asks a different question entirely. Instead of asking how to avoid initialization work at request time, ask whether that work needs to happen more than once at all. Checkpoint-restore answers with a firm no. Boot an environment once, run all its initialization to completion, freeze it, and capture a complete snapshot of its memory, CPU state, and file handles. When the next request arrives, restore from the snapshot rather than rebooting. The initialization path disappears from the critical path because it already happened, before any user triggered the system.
AWS Lambda SnapStart is the production deployment of this idea: when a developer publishes a function, Lambda initializes it once, takes an encrypted Firecracker snapshot of the warm execution environment, and caches it. Every subsequent invocation resumes from that snapshot rather than booting cold, with AWS reporting up to ten times faster startup at no additional charge.
The subtle catch is that clones share identical initial memory. Any code that assumes a unique random seed or a unique machine identifier will behave incorrectly, because every clone starts from the same frozen state. This is not a theoretical edge case. SnapStart ships with a dedicated hook interface specifically so developers can re-randomize those values on each restore before the function begins handling traffic.
Modern cloud platforms run millions of sandboxed execution environments per day. The challenge of spinning them up in milliseconds while maintaining complete isolation between tenants is what drove the development of microVM technology and snapshot-restore infrastructure.
Academic computer science spent years driving snapshot-restore startup toward zero, and the results redefined what was considered possible. The key insight from that work was that conventional sandbox optimization had been focused on the wrong layer entirely. Making the hypervisor and guest kernel faster cannot touch the initialization work that happens inside the guest, which is where most of the overhead actually lives.
The REAP system, published in 2021, attacked this from a precise angle. Even with snapshot-restore, startup was bounded by the speed of loading memory pages from disk: a restored process takes page faults, each one a round trip to storage. REAP observed that a given function accesses the same stable set of memory pages on every invocation. Record that working set once, then prefetch those pages in a single bulk read on every subsequent restore rather than faulting them in one at a time. The result was a one to nearly ten times speedup across different function types, eliminating 97 percent of page faults on average. The principle it demonstrated is the same one running through all the serious work in this area: the fastest start is the one that reuses state instead of reconstructing it.
For most of the history of serverless computing, checkpoint-restore worked well on CPU workloads and not at all on GPU ones. That gap became acutely painful when large language model inference arrived as a first-class cloud workload. Serving a model means loading gigabytes of weights into GPU memory, then running expensive one-time compilation steps: tracing computation graphs, capturing execution plans, compiling just-in-time kernels. The total cold start for a GPU function running a medium-sized model routinely stretched past 45 seconds. CPU memory snapshots could capture the host-side state but could not reach across the hardware bus into GPU memory, so weights and compiled kernels had to be rebuilt on every cold start.
NVIDIA's CUDA checkpoint-restore API, which matured through driver releases in 2024 and 2025, closed that gap by snapshotting device memory contents directly, along with kernels, streams, and execution contexts. One GPU-backed AI platform reported cold starts dropping from 45 seconds to 5 seconds after adoption. The important caveat is that GPU snapshots help when compilation and framework initialization dominate startup time, not when the bottleneck is the raw transfer of model weights from storage, which remains a bandwidth problem that snapshots cannot address.
What this entire arc of work has established is a principle now at the foundation of serious sandbox design: the security boundary and the initialization sequence are separable concerns. Building the walls is one operation. Starting the work is another. The walls can be built once, snapshotted, and cloned in milliseconds. Initialization can be captured at its most expensive moment and never repeated. Isolation does not require initialization, and the platforms that internalized that distinction earliest are the ones setting the benchmarks everyone else is now chasing.
Key references: AWS Firecracker project, USENIX NSDI 2020. Brooker, M., "Restoring Uniqueness in MicroVM Snapshots," AWS Blog, 2022. Du, D. et al., "Catalyzer: Sub-millisecond Startup for Serverless Computing with Initialization-less Booting," ASPLOS 2020. Ustiugov, D. et al., "Benchmarking, Analysis, and Optimization of Serverless Function Snapshots," ASPLOS 2021 (REAP). AWS Lambda SnapStart documentation, docs.aws.amazon.com, 2022. NVIDIA CUDA Checkpoint/Restore documentation, developer.nvidia.com, 2024. Modal Labs, "GPU Memory Snapshots," modal.com/blog, 2025. Google Cloud Run minimum instances documentation, cloud.google.com. E2B Sandbox infrastructure documentation, e2b.dev, 2025.
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.