DEV Community

Discussion on: 8 best practices for optimizing Lambda functions

Collapse
 
danielfy profile image
Daniel Fyhr

Thanks for sharing!

I have some questions regarding importing aws-sdk when you run a build tool (which is probably out of scope for your post). In lambda functions you can completely exclude aws-sdk from your bundle since it's provided by the lambda service (docs.aws.amazon.com/lambda/latest/...).

I'm not completely sure if it works like this so please let me know if I'm wrong.
When you exclude it you don't have to worry about import path. The entire bundle should be even smaller. I guess it would be slightly better performance too. Do you know of any reasons to avoid this? It's a pretty quick way to improve performance across many functions.