When developing a Python web app (Flask/uWSGI) and running it on my local machine, *.pyc
files are generated by the interpreter. My understanding is that these compiled files can make things load faster, but not necessarily run faster.
When I deploy this same app to production, it runs under a user account that has no write permissions on the local file system. There are no *.pyc
files committed to source control, and no effort is made to generate them during the deploy. Even if Python wanted to write a .pyc
file at runtime, it would not be able to.
Recently I started wondering if this has any tangible effect on the performance of the app, either in terms of the very first pageview after the process starts, or consistently throughout its entire lifetime.
Should I throw a python -m compileall
in as part of my deploy scripts?