Re: effect of JIT tuple deform? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: effect of JIT tuple deform?
Date
Msg-id CAFj8pRAOcSXNnykfH=M6mNaHo+g=FaUs=DLDZsOHdJbKujRFSg@mail.gmail.com
Whole thread Raw
In response to Re: effect of JIT tuple deform?  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: effect of JIT tuple deform?
List pgsql-hackers


2018-06-27 17:19 GMT+02:00 Tomas Vondra <tomas.vondra@2ndquadrant.com>:
On 06/26/2018 09:25 PM, Pavel Stehule wrote:
Hi

...

So I am able to see effect of jit_tuple_deforming, and very well, but only if optimization is active. When optimization is not active then jit_tuple_deforming does slowdown.

So maybe a usage of jit_tuple_deforming can be conditioned by jit_optimization?


Can you share the test case and some detail about the hardware and PostgreSQL configuration?

I did very simple test


0.

master branch without asserts, shared buffer to 1GB
tested on Lenovo T520 8GB RAM 8CPU, i7
Fedora 28, gcc  CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"  --with-llvm

1.

select 'create table wt(' || string_agg(format('%I int', 'c' || i),',') || ')' from generate_series(1,100) g(i) \gexec


2.

begin;
select 'insert into wt values(' || (select string_agg((random()*10000)::int::text,',') from generate_series(1,j - j + 100) g(i)) || ')' from generate_series(1,1000000) gg(j) \gexec
insert into wt select * from wt;
commit;

3.

set max_paralel_workers to 0; -- the effect of JIT will be more visible

analyze wt;
\timing

select sum(c99) from wt;

I tested some combination of:

jit: off on
jit_inline_above_cost: 0, 10000000000000
jit_optimize_above_cost: 0, 10000000000000
jit_tuple_deforming: on, off


My primitive tests shows nice possitive effect of jit_tuple_deforming if jit optimization is active. When jit optimization is not active, then jit_tuple_deforming did slowdown in my test.

So there is range of costs between 100000 and 500000 where jit_tuple_deforming didn't work well (without optimization)

I am limmited by small memory of my notebook - when I created table larger than 3GB, then I got IO waits on my crypted disc, and any effect of JIT was eliminated.

Regards

Pavel




regards

--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: WAL prefetch
Next
From: Andres Freund
Date:
Subject: Re: assert in nested SQL procedure call in current HEAD