I'm trying to make the switch from AWS Lambda warmup (calling the function every 5 minutes) to provisioned concurrency as I was told it's a better way to avoid cold starts. Nevertheless, when using provisioned concurrency, my script is going through all packages imports, which makes the latency quite important. For the same lambda function in two different environments, one using warmup and one using provisioned concurrency, the one using warmup executes in less than 1s when the other one takes almost a minute.
All of my imports are of course outside of the function handler, and the provisioned concurrency seems to be correctly enabled for my Lambda. To enable it I just added this line in my .yml file:
provisionedConcurrency: 3
Am I missing something or provisioned concurrency is not handling libraries imports when creating containers?