Sv: Sv: Re: Query is over 2x slower with jit=on

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Sv: Sv: Re: Query is over 2x slower with jit=on
Date: 2018-04-26 11:06:50
Message-ID: VisenaEmail.35.9fa76a2dba543edd.1630199c6f4@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

På onsdag 18. april 2018 kl. 18:26:03, skrev Andreas Joseph Krogh <
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>>:
På onsdag 18. april 2018 kl. 17:50:55, skrev Andres Freund <andres(at)anarazel(dot)de
<mailto:andres(at)anarazel(dot)de>>:
On 2018-04-18 17:35:31 +0200, Andreas Joseph Krogh wrote:
> With jit=on:
> https://explain.depesz.com/s/vYB
> Planning Time: 0.336 ms
>  JIT:
>   Functions: 716
>   Generation Time: 78.404 ms
>   Inlining: false
>   Inlining Time: 0.000 ms
>   Optimization: false
>   Optimization Time: 43.916 ms
>   Emission Time: 600.031 ms

Any chance this is a debug LLVM build?

> What's the deal with jit making it slower?

JIT has cost, and sometimes it's not beneficial. Here our heuristics
when to JIT appear to be a bit off. In the parallel world it's worse
because the JITing is duplicated for parallel workers atm.
 
PostgreSQL is built with "--enable-debug --with-llvm". LLVM is the one which
comes with Ubuntu-17.10.
 
Some more info;
 
Without --enable-debug (seems this didn't impact performance mutch):
 
First 5 executions (prepared-statement issued from psql)
 Planning Time: 47.634 ms
 JIT:
   Functions: 725
   Generation Time: 74.748 ms
   Inlining: true
   Inlining Time: 90.763 ms
   Optimization: true
   Optimization Time: 5822.516 ms
   Emission Time: 3089.127 ms
 Execution Time: 16375.996 ms
 
 
After 5 executions (prepared-statement issued from psql)
Planning Time: 0.385 ms
JIT:
  Functions: 716
  Generation Time: 76.382 ms
  Inlining: false
  Inlining Time: 0.000 ms
  Optimization: false
  Optimization Time: 41.709 ms
  Emission Time: 613.074 ms
Execution Time: 2031.830 ms
 
jit=off:
 
Planning Time: 0.171 ms
Execution Time: 832.489 ms
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

 

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2018-04-26 11:34:19 Re: Built-in connection pooling
Previous Message Kyotaro HORIGUCHI 2018-04-26 11:06:45 Re: Oddity in tuple routing for foreign partitions