New expression evaluator and indirect jumps - Mailing list pgsql-hackers

From Jeff Davis
Subject New expression evaluator and indirect jumps
Date
Msg-id CAMp0ubcPXTq84GSw=f5xx+ZLGYDozbTXY0_JprummL6tKyV-Pw@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Andres,

Thank you for your great work on the expression evaluator:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=b8d7f053c5c2bf2a7e8734fe3327f6a8bc711755

I was looking at the dispatch code, and it goes to significant effort
(using computed goto) to generate many indirect jumps instead of just
one. The reasoning is that CPUs can do better branch prediction when
it can predict separately for each of the indirect jumps.

But the paper here: https://hal.inria.fr/hal-01100647/document claims
that it's not really needed on newer CPUs because they are better at
branch prediction. I skimmed it, and if I understand correctly, modern
branch predictors use some history, so it can predict based on the
instructions executed before it got to the indirect jump.

I tried looking through the discussion on this list, but most seemed
to resolve around which compilers generated the assembly we wanted
rather than how much it actually improved performance. Can someone
please point me to the numbers? Do they refute the conclusions in the
paper, or are we concerned about a wider range of processors?

Regards,   Jeff Davis



pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: Page Scan Mode in Hash Index
Next
From: Andres Freund
Date:
Subject: Re: New expression evaluator and indirect jumps