-
Notifications
You must be signed in to change notification settings - Fork 1.2k
JIT --with-llvm #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The Debian variants (non-Alpine) should already support this (https://salsa.debian.org/postgresql/postgresql/blob/6fc4a5a131f20c0d2979345d527c34c50cda26e2/debian/rules#L33-36 and https://salsa.debian.org/postgresql/postgresql/blob/6fc4a5a131f20c0d2979345d527c34c50cda26e2/debian/control#L33). Do you have a simple way we could confirm? For Alpine variants, I think https://pkgs.alpinelinux.org/package/v3.8/main/x86_64/llvm5-dev probably bodes well for the possibility of implementing this. 👍 |
I tried using |
Ok, using I've also managed to verify that my Alpine changes work to do the same, but the size difference is pretty significant; ~72.9MB up to ~132MB with JIT support compiled in. Edit: for reference, here's the full diff I was testing with: diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile
index 52e3cf5..5702501 100644
--- a/11/alpine/Dockerfile
+++ b/11/alpine/Dockerfile
@@ -44,6 +44,7 @@ RUN set -ex \
\
&& apk add --no-cache --virtual .build-deps \
bison \
+ clang llvm5-dev g++ \
coreutils \
dpkg-dev dpkg \
flex \
@@ -110,6 +111,7 @@ RUN set -ex \
--with-libxml \
--with-libxslt \
--with-icu \
+ --with-llvm \
&& make -j "$(nproc)" world \
&& make install-world \
&& make -C contrib install \ |
That's great, I will switch to Debian version for now. I suppose a note in the Readme would be nice for this in terms of alpine, or a separate image tag alpine-llvm or something of the sort. |
I guess a note in the documentation (https://github.com/docker-library/docs/tree/master/postgres) would probably be a good idea for now, although I'm not sure what we want to do with this longer-term. PostgreSQL obviously is going all-in behind LLVM ( I'm wary of adding a new variant because I'm not convinced it would stay the appropriate solution long-term. 😕 |
Ah, given #484 (comment) ("The problem with versions earlier than 6.0 is that they don't cope with C++ exceptions, so certain PostGIS queries make the server crash.") combined with https://pkgs.alpinelinux.org/packages?name=*llvm*&branch=v3.8&arch=x86_64 (nothing newer than LLVM 5.0.1, and even Alpine Edge doesn't seem to have 6+ yet), I'm going to close this. Without compiling LLVM from source, we can't currently get a new enough version in Alpine to actually support what PostgreSQL needs, so this point is actually currently moot (compiling LLVM from source is a no-go -- that's way too heavyweight 😅). |
@tianon Is there any chance to add variants PG standard/alpine with enabled JIT even it means an increased size of the final docker image? |
alpine 3.10 has llvm7 and llvm8 now. Does this help with adding this feature? |
And JIT is enabled by default for PostgreSQL 12. @tianon is it worth to reconsider this? |
Yes, thanks for the prod. 👍 |
Postgres 11 comes with the new JIT compilation feature:
https://www.postgresql.org/about/news/1855/
https://www.postgresql.org/docs/devel/static/jit-reason.html
Also from:
https://www.postgresql.org/docs/devel/static/install-procedure.html#CONFIGURE-WITH-LLVM
Would be great to have JIT in Postgres 11 Docker images.
The text was updated successfully, but these errors were encountered: