Optimized Python Docker Image

by webologyon 12/2/2017, 7:43 PMwith 17 comments

by Davieyon 12/2/2017, 9:01 PM

Binary docker image, with no (public) reproducible build system? No thanks.

by znpyon 12/3/2017, 10:58 AM

So I see that profile-guided optimization are being used.

Profile-guided optimization, in layman terms, means that you run you code under a profiler for a while, see what parts (branches, functions, data structures etc) are being used the most and use this information to make a build of your code that considers the profiler's findings when doing optimization.

So what does it mean? It means, basically, that revsys is publishing a python build that is optimized for their use-case. Which may or may not be your use-case. This is not good nor bad.

Still, the claim "up to 19% faster" is false in general (but true in a particular case -- their use case).

Just keep this in mind, because this python build might perform worse than a regular python build.

by rcarmoon 12/2/2017, 10:59 PM

I've been using --enable-optimizations for a while, and built my own 3.6 images a couple of weeks back.

Here's the Dockerfiles and readme:

https://github.com/rcarmo/ubuntu-python

by muxatoron 12/2/2017, 11:19 PM

Am I totally misunderstanding something or there is no Dockerfile referenced? If so, is this just a binary blob I pull from a public registry?

I have some trust concerns about basing my infrastructure on something opaque.

by alex-on 12/2/2017, 11:56 PM

This was just mentioned today at north bay python.

Another alternative for a fast speed up by changing your base image is trying out the pypy images.

by StavrosKon 12/2/2017, 8:49 PM

Why aren't these just upstreamed onto the official Python binaries?

by Twirrimon 12/3/2017, 12:13 AM

The 10%ish speed boost is all down to PGO, I'm assuming?