Hacker News new | ask | show | jobs
by winrid 1547 days ago
By writing more code in this case, I think you're just referring to using a type system.

Yes, you type a little more, and your code is easier to refactor and change in the mid/long term. So you save time, and sanity.

Not mentioning the cost of using a slower runtime with Python... I've seen serverless bills of 100k+ a month with NodeJS. If something twice as slow was used, and Python is more than twice as slow on average, then we'd be talking 200k+...

1 comments

Python can be faster than nodejs in many (but far from all) cases. It depends a lot on the workloads and environment. No general benchmark will tell the whole story.

Here Python came out on top:

https://scribe.rip/filia-aleks/aws-lambda-battle-2021-perfor...

https://scribe.rip/ville-karkkainen/python-is-slow-wait-its-...

In our case they were long lived lamdas consuming from a queue, so a JIT and good memory management mattered more.