In the previous section, we saw how testing your function at scale with different memory settings results in more CPU capacity allocated, which could impact your Lambda function's performance and cost. However, before optimizing the resource usage, you need to optimize your function's code first to help reduce the amount of memory and CPU it needs in order to be executed. Contrary to traditional applications, AWS Lambda manages and patches the infrastructure for you, which allows developers to focus on writing good quality, efficient, and world-class code that executes fast.
The following are some points you should keep in mind when designing your function with AWS Lambda in a cost...