Is there a recommended bundle size to
Is there a recommended bundle size to remain below for workers for the start-up time to remain unnoticable? Should I be concerned about increasing 500KB -> 1MB?
3 Replies
Startup time is subject to more than just bundle size.
You should always be concerned about significant increases in size as it is hard for it not to have an impact.
I think the best you can do is monitor and measure.
We do have a new experimental compat flag
new_module_registry: https://github.com/cloudflare/workerd/blob/68d394ff7c3e8d095031fab33ec8599fb478ee1c/src/workerd/io/compatibility-date.capnp#L513-L517GitHub
workerd/src/workerd/io/compatibility-date.capnp at 68d394ff7c3e8d09...
The JavaScript / Wasm runtime that powers Cloudflare Workers - cloudflare/workerd
When this becomes stable we will be able to avoid loading and parsing dynamic imports before they are requested.
This will help start up time if you split up your app into lazy loaded chunks