Re: WIP: expression evaluation improvements
Soumyadeep Chakraborty <sochakraborty@pivotal.io>
From: Soumyadeep Chakraborty <sochakraborty@pivotal.io>
To: Andres Freund <andres@anarazel.de>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2020-02-20T01:17:57Z
Lists: pgsql-hackers
Attachments
- v3-0001-Resolve-PL-handler-names-for-JITed-code-instead-o.patch (application/octet-stream) patch v3-0001
Hey Andres, > Awesome! +1. Attached 2nd version of patch rebased on master. > (v2-0001-Resolve-PL-handler-names-for-JITed-code-instead-o.patch) > > > > > Did you check whether there's any cases this fails in the tree with your > > patch applied? The way I usually do that is by running the regression > > tests like > > PGOPTIONS='-cjit_above_cost=0' make -s -Otarget check-world > > > > (which will take a bit longer if use an optimized LLVM build, and a > > *lot* longer if you use a debug llvm build) > > > > Great suggestion! I used: > PGOPTIONS='-c jit_above_cost=0' gmake installcheck-world > It all passed except a couple of logical decoding tests that never pass > on my machine for any tree (t/006_logical_decoding.pl and > t/010_logical_decoding_timelines.pl) and point (which seems to be failing > even > on master as of: d80be6f2f) I have attached the regression.diffs which > captures > the point failure. I have attached the 3rd version of the patch rebased on master. I made one slight modification to the previous patch. PL handlers, such as that of plsh, can be in an external library. So I account for that in modname (earlier naively I set it to NULL). There are also some minor changes to the comments and I have rehashed the commit message. Apart from running the regress tests as you suggested above, I installed plsh and forced JIT on the following: CREATE FUNCTION query_plsh (x int) RETURNS text LANGUAGE plsh AS $$ #!/bin/sh psql -At -c "select 1" $$; SELECT query_plsh(5); and I also ran plsh's make installcheck with jit_above_cost = 0. Everything looks good. I think this is ready for another round of review. Thanks!! Soumyadeep
Commits
-
Add special case fast-paths for strict functions
- d35d32d7112b 18.0 landed
-
Replace EEOP_DONE with special steps for return/no return
- 8dd7c7cd0a26 18.0 landed
-
jit: Reference expression step functions via llvmjit_types.
- b059d2f45685 13.0 landed
-
jit: Remove redundancies in expression evaluation code generation.
- e6f86f8dd983 13.0 landed
-
expression eval: Don't redundantly keep track of AggState.
- 1fdb7f9789c4 13.0 landed
-
jit: Reference functions by name in IOCOERCE steps.
- 8c2769405ff1 13.0 landed
-
expression eval, jit: Minor code cleanups.
- 1ec7679f1b67 13.0 landed