From: | Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: VOPS-2.0 |
Date: | 2018-11-28 13:56:21 |
Message-ID: | 9cba9e63-992b-0f17-281e-ea91a37591da@postgrespro.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-announce pgsql-hackers |
On 28.11.2018 16:18, Bruce Momjian wrote:
> On Wed, Nov 28, 2018 at 01:01:03PM +0300, Konstantin Knizhnik wrote:
>> Hi,
>>
>> I want to introduce new version of VOPS extension for Postgres (vectorized
>> operations) providing new, more convenient way of usage:
>> auto-substitution of projections.
> [Announce post moved to hackers.]
>
> I remember the good performance numbers from this feature. How does
> this interact with the JIT executor feature, which is also designed to
> speed up the executor? Is it something that can be combined with JIT?
>
JIT and vector execution are more or less alternative solutions of the
same problem: eliminate interpretation overhead.
In JIT it was done be replacing interpretation with native code execution.
In VOPS - by processing more elements by each operation.
This is the implementation of binary operations in VOPS:
PG_FUNCTION_INFO_V1(vops_##TYPE##_##OP); \
Datum vops_##TYPE##_##OP(PG_FUNCTION_ARGS) \
{ \
vops_##TYPE* left = (vops_##TYPE*)PG_GETARG_POINTER(0); \
vops_##TYPE* right = (vops_##TYPE*)PG_GETARG_POINTER(1); \
vops_##TYPE* result = (vops_##TYPE*)palloc(sizeof(vops_##TYPE));\
int i; \
for (i = 0; i < TILE_SIZE; i++) result->payload[i] =
left->payload[i] COP right->payload[i]; \
So it is just loop through TILE_SIZE elements (128 by default) for which
compiler generates optimal code.
Interpretation overhead is not eliminate but is divided by 128.
In principle this two approaches can be combined (as it was done for
example in HyPer).
But practically, at least for expressions evaluation is has not so much
sense.
Because code generated by compiler for vector function mentioned above
at better (or at least not worser) than one generated by LLVM.
And 100 times reduced interpretation overhead is not noticeable.
Concerning results: now Postgres with JIT is executing Q1 about 30%
faster than without JIT.
VOPS is executing Q1 about 10 times faster.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
From | Date | Subject | |
---|---|---|---|
Next Message | Konstantin Knizhnik | 2018-11-28 14:08:06 | Re: VOPS-2.0 |
Previous Message | Alvaro Herrera | 2018-11-28 13:45:37 | Re: VOPS-2.0 |
From | Date | Subject | |
---|---|---|---|
Next Message | Konstantin Knizhnik | 2018-11-28 14:08:06 | Re: VOPS-2.0 |
Previous Message | Bruce Momjian | 2018-11-28 13:51:54 | Re: Unnecessary asterisk in comment in postgres_fdw.c |