Next.js Discord

Discord Forum

Understanding the Functions size

Unanswered
Can de Chira posted this in #help-forum
Open in Discord
Can de ChiraOP
Wondering if there is an easy way to understand why these functions seem so large and all are about the samesize?

Is this something I should even worry about?

6 Replies

@Can de Chira Wondering if there is an easy way to understand _why_ these functions seem so large and all are about the samesize? Is this something I should even worry about?
i think they are due to the number of dependencies you use on those functions.

heavier functions will have longer cold start. so if performance is an issue for you, you might want to optimise the dependencies of your pages.
Can de ChiraOP
Hmm that’s interesting.. I’m not sure why they’d all be the same then. As some of them have overlap (e.g. User routes check auth) but nothing is 100% the same.

I’ll have to dig into how to better understand what’s causing the size here. I’m not sure if I’m seeing performance issues yet, just 6.1mb seems large.
don't worry, my app has a route with 15 MB. they only affect cold start, so when the site spends a long time without visitors, the route will take time to boot up, but that's about it. other than that it still works smoothly
Can de ChiraOP
🫡 any way to monitor the cold start times?
in the project log, you can view the log of each request, and if that request encounters a cold start you can see it in the request details
though honestly you need not worry about this much