3 ms·
It's cheaper when you reduce resource requirements. If you're loading a bunch of code in memory you don't end up using, you're wasting memory. Depending on how
by nijave 5y ago
It's cheaper when you reduce resource requirements.
If you're loading a bunch of code in memory you don't end up using, you're wasting memory. Depending on how modular your code is, you may end up loading other external dependencies that don't get used (like initializing database connections). Likewise, for containers, you can usually make the container image smaller reducing data transfer, reducing Docker pull time, reducing host IOPs to unpack the image.
A lot of those problems can be optimized around, but sometimes it's quite a bit of work if you're already on a platform or framework that makes assumptions
If you're not deploying or scaling often and you have other mitigations like lazy loading to reduce memory, there may be no advantage.