AWS Lambda: Does Language change affect RAM(Memory) Usage or cost of the service?
Question: AWS Lambda has 2 different programming language options and as you know while
we are speaking about the Lambda, RAM(Memory) usage is very important thing.

Is there any difference about Node.js's RAM usage and Python's RAM Usage?

If there is a something like when we use it, it will be more cost efficient,
I'm thinking about using only that language. Also maybe Node.js execution can
be much faster than Python and because of that RAM disadvantage could not be a
problem.


Answer: From the [AWS Lambda pricing page](https://aws.amazon.com/lambda/pricing/):

> Duration is calculated from the time your code begins executing until it
> returns or otherwise terminates, rounded up to the nearest 100ms. The price
> depends on the amount of memory you allocate to your function. You are
> charged $0.00001667 for every GB-second used.

RAM usage for the language runtime does not _directly_ affect the pricing.

You choose the RAM _statically_ when you define your Lambda function, and that
does have an effect on the pricing, but it done _once_ , and all invocation
get the same RAM amount, and cost accordingly.

However - you do pay more according to the **duration** of the invocation.

I would _expect_ Amazon not to charge you for the time it takes to bootstrap
the environment - the pricing page does say _"from the time**your code**
begins executing until it returns"_.  
(this is speculative, of course, but it wouldn't look fair to charge for the
overhead)

Different languages and runtimes can have [different execution
times](https://bjpelc.wordpress.com/2015/01/10/yet-another-language-speed-
test-counting-primes-c-c-java-javascript-php-python-and-ruby-2/), even for
identical (or idiomatic) programs.  
This difference in speed can, and will, affect the price.

