Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crzFU-0004D6-5t for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Mar 2017 03:53:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1crzFT-0007mp-JM for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Mar 2017 03:53:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1crzDz-00058s-7K for pgsql-hackers@postgresql.org; Sun, 26 Mar 2017 03:52:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1crzDw-0005fI-47 for pgsql-hackers@postgresql.org; Sun, 26 Mar 2017 03:52:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v2Q3pjdw023530; Sat, 25 Mar 2017 23:51:45 -0400 From: Tom Lane To: Andres Freund cc: Ants Aasma , Heikki Linnakangas , Tomas Vondra , PostgreSQL-development Subject: Re: WIP: Faster Expression Processing v4 In-reply-to: <3CC5B4C5-3ADB-4296-A04B-64F594A4CE4F@anarazel.de> References: <20170324004734.3a2dokbfofiz6ylu@alap3.anarazel.de> <30270.1490318779@sss.pgh.pa.us> <20170324013412.qy7ltnnqv5m7qiuc@alap3.anarazel.de> <31825.1490320683@sss.pgh.pa.us> <20170324020003.4rt63xty7xpb4akq@alap3.anarazel.de> <22215.1490369187@sss.pgh.pa.us> <20170324182742.3r4qndpugtx6ga3t@alap3.anarazel.de> <22833.1490390175@sss.pgh.pa.us> <13918.1490410879@sss.pgh.pa.us> <5768.1490458935@sss.pgh.pa.us> <20170325222202.uz6evsjqrtwjnql6@alap3.anarazel.de> <3CC5B4C5-3ADB-4296-A04B-64F594A4CE4F@anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 25 Mar 2017 17:23:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23528.1490500305.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 25 Mar 2017 23:51:45 -0400 Message-ID: <23529.1490500305@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On March 25, 2017 4:56:11 PM PDT, Ants Aasma wrote: >> I haven't had the time to research this properly, but initial tests >> show that with GCC 6.2 adding >>=20 >> #pragma GCC optimize ("no-crossjumping") >>=20 >> fixes merging of the op tail jumps. >>=20 >> Some quick and dirty benchmarking suggests that the benefit for the >> interpreter is about 15% (5% speedup on a workload that spends 1/3 in >> ExecInterpExpr). My idea of prefetching op->resnull/resvalue to local >> vars before the indirect jump is somewhere between a tiny benefit and >> no effect, certainly not worth introducing extra complexity. Clang 3.8 >> does the correct thing out of the box and is a couple of percent >> faster than GCC with the pragma. > That's large enough to be worth doing (although I recall you seeing all j= umps commonalized). We should probably do this on a per function basis how= ever (either using pragma push option, or function attributes). Seems like it would be fine to do it on a per-file basis. If you're worried about pessimizing the out-of-line subroutines, we could move those to a different file --- it's pretty questionable that they're in execExprInterp.c in the first place, considering they're meant to be used by more than just that execution method. regards, tom lane --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers