does trimming a 14mb deploy bundle actually move cold start or is it all runtime init
node 20, deploy artifact is about 14mb zipped and most of that is one large sdk plus a date library i use in three places. cold start sits around 1.2s and warm requests are 40ms. before i spend a day on bundling i want to know whether artifact size is the lever or whether the time is going somewhere else entirely. has anyone measured the difference on a real service?
@row_level_sam · 6mo ago
i did exactly this experiment. bundling and tree shaking took the artifact from 14mb to just under 4mb and cold start went from about 1.2s to 1.05s, which was real but not what i had been promised. the actual win came afterwards from moving two sdk clients out of module scope and requiring them lazily inside the handlers that needed them, which took another 300ms off because most requests never construct them at all.
Reply
Report