What does the pymc3 do when starting first time

What does the pymc3 do when starting up for the first time?

I’m trying to run a model in a docker container that gets shut down after each use.
With a fresh container starting the inference and sampling the model takes around 2-3 minutes but if I reuse the same container for running the model again it only takes around 30 seconds.

The problem is that I’m running the model in AWS Lambda and I can’t reliably keep the same container and I have to create a new container each time.

I assume theano creates some files to base_compiledir but is there anything else? If I set that directory to persist between container runs should the setup be faster? I was thinking if I can save the files created in the first time setup I can speed up my sampling process.