Re: JIT overhead slowdown

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Luis Carril <luis(dot)carril(at)swarm64(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: JIT overhead slowdown
Date: 2019-02-14 21:03:34
Message-ID: 20190214210334.GA1732@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

On Fri, Jan 18, 2019 at 02:12:23PM +0000, Luis Carril wrote:
> we noticed that in the presence of a schema with many partitions the jitting overhead penalizes the total query execution time so much that the planner should have decided not to jit at all. For example without jitting we go a 8.3 s execution time and with jitting enabled 13.8 s.
...
> Is this behavior expected? Is the cost function for jitting missing some circumstances?

On Fri, Jan 18, 2019 at 08:42:54AM -0800, Andres Freund wrote:
> The costing doesn't take the effect of overhead of repeated JITing in
> each worker into account. I could give you a test patch that does, if
> you want to play around with it?

On Fri, Jan 18, 2019 at 06:02:43PM +0000, Luis Carril wrote:
> yes please it would be much apreciated.

I'm also interested to try that ; on re-enabling JIT in 11.2, I see that JITed
queries seem to be universally slower than non-JIT.

I found that was discussed here:
https://www.postgresql.org/message-id/20180822161241.je6nghzjsktbb57b%40alap3.anarazel.de
https://www.postgresql.org/message-id/20180624203633.uxirvmigzdhcyjsd%40alap3.anarazel.de

Multiplying JIT cost by nworkers seems like an obvious thing to try, but I
wondered whether it's really correct? Certainly repeated JITing takes N times
more CPU time, but doesn't make the query slower...unless the CPU resources are
starved and limiting ?

Justin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Lewis 2019-02-14 21:45:10 Re: autovacuum big table taking hours and sometimes seconds
Previous Message Greg Stark 2019-02-14 20:29:56 Re: Q on SQL Performance tuning