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

Gregale · Updated 2026-12-01

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.

**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 framework       | Cold boot, no snapshot | Restore from snapshot | First answer after a restore | First answer while running |
| --------------------------- | ---------------------: | --------------------: | ---------------------------: | -------------------------: |
| Go (`net/http`)             |               1,071 ms |                 50 ms |                       460 ms |                     312 ms |
| Node.js 24 (Express 4)      |               1,072 ms |                 68 ms |                       487 ms |                     311 ms |
| Bun (Hono)                  |               1,081 ms |                 68 ms |                       484 ms |                     313 ms |
| Python (FastAPI on uvicorn) |               1,135 ms |                 83 ms |                       500 ms |                     315 ms |
| Java 25 (Spring Boot 4)     |               4,224 ms |                 78 ms |                       514 ms |                     309 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

| Platform               | What a cold start is                                             | What they publish                                                                                                                    |
| ---------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **AWS Lambda**         | A new execution environment, then your function's initialization | From 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 Run**   | A new container instance                                         | No typical figure; startup CPU boost and minimum instances reduce it                                                                 |
| **Vercel**             | A new function instance                                          | No typical figure; bytecode caching for Node.js 20 and later, and pre-warming on production deployments                              |
| **Cloudflare Workers** | A new V8 isolate, not a VM or container                          | Cloudflare says isolates eliminate the cold starts of the VM model                                                                   |
| **Fly.io**             | Starting a stopped Machine, or resuming a suspended one          | About 2 seconds or more from stopped; a few hundred milliseconds from suspended                                                      |
| **Koyeb**              | Waking a Service that scaled to zero                             | 1 to 5 seconds from deep sleep; about 200 ms from Light Sleep, in public preview                                                     |
| **Render** Free        | Spinning up a web service after 15 minutes without traffic       | About a minute                                                                                                                       |
| **Gregale**            | Resuming a paused VM, or restoring a parked app's snapshot       | Resume 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](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html),
[Lambda SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html),
[Cloud Run general development tips](https://docs.cloud.google.com/run/docs/tips/general),
[Vercel fluid compute](https://vercel.com/docs/fluid-compute),
[How Cloudflare Workers works](https://developers.cloudflare.com/workers/reference/how-workers-works/).
Checked on November 28, 2026:
[Koyeb Scale-to-Zero](https://www.koyeb.com/docs/run-and-scale/scale-to-zero),
[Render free instances](https://render.com/docs/free).
Checked on November 25, 2026:
[Fly.io autostop and autostart](https://docs.fly.io/launch/autostop-autostart).

## Related

- [Scale to zero without slow cold starts](https://gregale.dev/articles/scale-to-zero-without-cold-starts): the three idle states on Gregale and the published restore benchmark
- [Stop cold starts from stacking up across services](https://gregale.dev/articles/chained-cold-starts-wake-services-together)
- [How much does it cost to host an MCP server?](https://gregale.dev/articles/mcp-server-hosting-cost): measured first calls for an MCP server
- Reference: [How scaling to zero works](https://gregale.dev/docs/scale-to-zero.md)

## 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.

Canonical URL: https://gregale.dev/articles/cold-start-times-by-language

