Articles

How long is a cold start? Node.js, Python, Go, Bun and Java measured

Cold boot vs snapshot restore measured for Go, Node.js, Bun, FastAPI and Spring Boot apps, with what Lambda, Cloud Run, Vercel, Fly.io and Render publish.

Updated

A cold start takes anywhere from under 100 ms to several seconds: the platform has to start an instance, and then your runtime and framework have to start inside it. AWS Lambda says its cold starts range from under 100 ms to over a second. In our test on Gregale, small Go, Node.js, Bun and FastAPI apps each took about 1.1 seconds to boot from scratch, most of it starting the microVM rather than the language, and Spring Boot took 4.2 seconds. Restoring the same apps from a memory snapshot took 50 to 83 ms at the median, Spring Boot included.

Gregale publishes this page. What other platforms do comes from their own docs, checked between November 25 and December 1, 2026. The measurements are our own, from five test apps on Gregale on December 1, 2026, described below.

Cold boot vs snapshot restore, by language

Runtime and frameworkCold boot, no snapshotRestore from snapshotFirst answer after a restoreFirst answer while running
Go (net/http)1,071 ms50 ms460 ms312 ms
Node.js 24 (Express 4)1,072 ms68 ms487 ms311 ms
Bun (Hono)1,081 ms68 ms484 ms313 ms
Python (FastAPI on uvicorn)1,135 ms83 ms500 ms315 ms
Java 25 (Spring Boot 4)4,224 ms78 ms514 ms309 ms
  • Cold boot is the time from the start of the wake to the app answering its health check, with no snapshot to restore: Gregale boots the microVM, starts the runtime and the framework, and waits for readiness. Median of 3 fresh restarts each.
  • Restore is the time from the start of the wake to the app running again from the snapshot Gregale took after it first started. Median of 10 wakes each; 9 for Spring Boot, whose first wake found no snapshot yet.
  • First answer is what a client saw: the time from sending GET / to the response headers, on a new TLS connection from a laptop about 170 ms away from the region. Most of it is that network round trip, which is why even an app that was already running took about 310 ms.

Every app ran with 512 MB and answered GET / with a small JSON body; none used a database. The servers: Express 4 on Node.js, FastAPI on uvicorn, Go's net/http, Hono on Bun.serve, and Spring Boot 4 on Java 25 in a jlink runtime.

Why the language mattered less than the framework

For the four small apps, the cold boots were within 65 ms of each other, so most of that second was work that doesn't depend on the language, such as starting the microVM and its operating system (one of the three Go boots took only 339 ms). What a runtime loads before it can answer is what made the difference:

  • Go starts one static binary, so it has the least to do.
  • Node.js and Bun compile JavaScript and load every module the entry point imports. Express and Hono are small, so this was quick here; a large node_modules tree takes longer.
  • Python imports each module and its dependencies at startup. FastAPI pulls in Pydantic and Starlette; data libraries such as pandas take far longer to import.
  • Java starts the JVM, loads classes, and Spring Boot scans and wires its application context. That added about 3 seconds even for a one-endpoint app. Its first request after a cold boot was slow too: when one wake in our test found no snapshot to restore, the first answer took 7.2 seconds.

A snapshot skips all of that. It saves the memory of a process that has already started, so a restore took about as long for Spring Boot as for Go.

What other platforms say about cold starts

PlatformWhat a cold start isWhat they publish
AWS LambdaA new execution environment, then your function's initializationFrom under 100 ms to over 1 second, in under 1% of invocations. SnapStart restores a snapshot for Java, Python and .NET, not Node.js
Google Cloud RunA new container instanceNo typical figure; startup CPU boost and minimum instances reduce it
VercelA new function instanceNo typical figure; bytecode caching for Node.js 20 and later, and pre-warming on production deployments
Cloudflare WorkersA new V8 isolate, not a VM or containerCloudflare says isolates eliminate the cold starts of the VM model
Fly.ioStarting a stopped Machine, or resuming a suspended oneAbout 2 seconds or more from stopped; a few hundred milliseconds from suspended
KoyebWaking a Service that scaled to zero1 to 5 seconds from deep sleep; about 200 ms from Light Sleep, in public preview
Render FreeSpinning up a web service after 15 minutes without trafficAbout a minute
GregaleResuming a paused VM, or restoring a parked app's snapshotResume in about a millisecond; restore 50 to 83 ms at the median in our test, whatever the language

Lambda SnapStart, Fly.io's suspend, Koyeb's Light Sleep and Gregale all work the same way: they keep the memory of an app that has already started and bring it back instead of starting it again.

How to shorten cold starts on any platform

  • Load less at startup. Import heavy modules inside the function that needs them, drop dependencies you don't use, and avoid work at import time such as reading large files or opening connections you may not need.
  • Connect lazily. Open the database connection on the first request that needs it, with a short timeout, so startup doesn't wait on another service.
  • Keep one instance warm where the platform allows it: Lambda provisioned concurrency, Cloud Run minimum instances, Fly.io min_machines_running, or --min 1 on Gregale. You pay for that instance all the time.
  • Use a snapshot when it is offered. SnapStart on Lambda for Java, Python and .NET, suspend on Fly.io, Light Sleep on Koyeb, or Gregale, where every app wakes from a snapshot by default.

Measure your own on Gregale

Every response carries x-faas-wake: hot, restored or cold, and a wake has an id you can look up:

sh
curl -sI https://my-api.gregale.app/ | grep -i x-faas-wake
gregale app park my-api                     # park it now, to test a wake
gregale app wake-timeline my-api <wake-id>  # restore, readiness and first byte

Sources

Checked on December 1, 2026: AWS Lambda execution environment lifecycle, Lambda SnapStart, Cloud Run general development tips, Vercel fluid compute, How Cloudflare Workers works. Checked on November 28, 2026: Koyeb Scale-to-Zero, Render free instances. Checked on November 25, 2026: Fly.io autostop and autostart.

Questions

How long does a cold start take?

From under 100 ms to several seconds, depending on the platform and on what your app loads at startup. AWS Lambda puts its cold starts between under 100 ms and over a second. In our test on Gregale, small Go, Node.js, Bun and FastAPI apps booted from scratch in about 1.1 seconds and Spring Boot in 4.2 seconds; restoring the same apps from a memory snapshot took 50 to 83 ms at the median.

Which language has the fastest cold start?

Go usually starts fastest, because it runs one static binary. In our test the gap between small Go, Node.js, Bun and FastAPI apps was only 65 ms (1,071 to 1,135 ms), while Spring Boot on Java took 4.2 seconds. What the app loads at startup, its framework and imports, matters more than the language.

How do I avoid cold starts without paying for an always-on instance?

Use a platform that restores a snapshot of the started app instead of booting it: Lambda SnapStart for Java, Python and .NET, suspend on Fly.io, Light Sleep on Koyeb (in preview), or Gregale, where every app wakes from a snapshot by default. Otherwise, load less at startup and connect to databases lazily.

Why is Spring Boot so slow to cold start?

The JVM has to start and load classes, and Spring Boot scans and wires its application context before it can serve a request. In our test a one-endpoint Spring Boot 4 app took 4.2 seconds to become ready from scratch, and a request that had to wait for such a boot got its first answer after 7.2 seconds. Restored from a snapshot, the same app was ready in 78 ms.