top | item 46119960

(no title)

ju-st | 3 months ago

Would be interesting to add a cold start + "import boto3" benchmark for Python as importing boto3 takes forever on lambdas with little memory. For this scenario I only know this benchmark but it is from 2021 https://github.com/MauriceBrg/aws-blog.de-projects/tree/mast...

discuss

order

torginus|3 months ago

I don't really use Python, but most AWS SDKs seem to be autogenerated for each language, and they're pretty much just thin wrappers over REST calls to interal AWS endpoints.

I dunno why a Python impl would be particularly heavy.

tyingq|2 months ago

Sprawling imports of text source in hundreds of files without lazy loading.

anentropic|3 months ago

if imports are slow one should probably look into pre-compiling .pyc files into the Lambda bundle

coredog64|3 months ago

This is a well known issue, and the fix is not to create any boto3 clients at runtime. Instead, ensure they're created globally (even if you throw them away) as the work then gets done once during the init period. The init period gets additional CPU allocation, so this is essentially "free" CPU.

Source: I'm a former AWS employee.