Back to articles
Your Node.js app is slow to start. You just don't know which module to blame.

Your Node.js app is slow to start. You just don't know which module to blame.

via Dev.to WebdevAryan Tiwari

Last month I was debugging a startup regression at work. Our Node.js service went from ~300ms boot to nearly 900ms overnight. No new features. No infra changes. Just a routine dependency bump. The usual approach? Comment out requires one by one. Bisect package.json . Stare at --cpu-prof output and pretend to understand V8 internals. I wanted something simpler: run one command, see which module is eating my startup time, and know if the cost is in the module itself or in everything it drags in. So I built coldstart — a zero-dependency startup profiler for Node.js that instruments Module._load , reconstructs the dependency tree, and shows you exactly where boot time goes. Full transparency: I used Claude pretty heavily while building this — for scaffolding the ESM loader hooks, generating the flamegraph HTML template, and iterating on the tree rendering logic. The core idea (patching Module._load with performance.now() bookends) and the architecture were mine, but AI absolutely accelerat

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles