Re: Greatest Common Divisor

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Chapman Flack <chap(at)anastigmatix(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Greatest Common Divisor
Date: 2020-01-06 12:11:42
Message-ID: CA+TgmoaQXaOZtH-WcwMKbBOiiWtBvrw3giVN+XOvYieXG8QUXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 4, 2020 at 4:21 PM Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
> In GCD implementations, for instance:
>
> if (arg1 == PG_INT32_MIN)
> if (arg2 == 0 || arg2 == PG_INT32_MIN)
>
> And possibly a "likely" on the while.

I don't think decoration the code with likely() and unlikely() all
over the place is a very good idea. Odds are good that we'll end up
with a bunch that are actually non-optimal, and nobody will ever
figure it out because it's hard to figure out. I have a hard time
believing that we're going to be much worse off if we just write the
code normally.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2020-01-06 12:17:43 Re: [Proposal] Global temporary tables
Previous Message Rafia Sabih 2020-01-06 11:25:32 Re: adding partitioned tables to publications