Wrangler Now Shows You Exactly How Heavy Your Worker's Startup Is!
Hey everyone, it's Shiichan! I found news that makes the Workers dev experience even better, so let's dig in.
Cloudflare ChangelogWhat was announced?
Cloudflare's Changelog announced that the wrangler check startup command now reports your Worker's raw and gzip-compressed bundle sizes. On top of that, it summarizes local CPU activity during startup directly in your terminal.
Why it matters
A Worker has to evaluate its module and start up before it can handle a request, so a large bundle or heavy startup work directly adds to cold-start latency. But until now, there wasn't a quick way to see exactly which code or dependency was slowing that startup down, so tracking down the cause took real effort.
What changes
Running wrangler check startup now surfaces what's heavy at startup right away. With bundle size and a CPU breakdown visible at a glance, you can quickly check any Worker you're worried about before you ever deploy it.
Dive Deep
All you need to run is:
wrangler check startup
The output includes:
- Your Worker's raw and gzip-compressed bundle size
- The profile window duration
- Sampled time
- Active time, including garbage collection time within it
- Idle time
- The sample count
In the example from the announcement, the bundle was 7171.25 KiB (2197.00 KiB gzipped), with a 70.3 ms profile window: 38.5 ms active (including 3.7 ms of garbage collection) and 31.8 ms idle.
Wrangler also still saves a .cpuprofile file for deeper analysis, which you can load into Chrome DevTools or VS Code for a flamegraph view. One important caveat: this profile is measured on your local machine's CPU, which differs from the CPU your Worker runs on in Cloudflare's network. So it's great for understanding where time goes, but the absolute startup time shouldn't be expected to exactly match production. This feature requires Wrangler 4.116.0 or later.
Wrap-up
wrangler check startupnow prints a summary of bundle size and startup CPU activity in your terminal- The output covers bundle size (raw/gzip), profile window, active/idle time, and sample count
- A
.cpuprofilefile is still written for deeper analysis in Chrome DevTools or VS Code - Since it measures your local CPU, the absolute numbers won't exactly match production cold starts
- Requires Wrangler 4.116.0 or later
If you care about cold starts and want to trim your Worker's bundle, this is an update you can try right now!