From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Marginal performance improvement for fast-path locking |
Date: | 2013-11-28 19:25:28 |
Message-ID: | CA+TgmoaMRKJH89M9R7T1re_7MbNgUBhH8vvYV0cxxu1+nW4fXA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Nov 28, 2013 at 2:23 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Nov 28, 2013 at 1:46 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> We could add an extra test in FastPathGrantRelationLock's loop to make
>>> it remember the first unused slot rather than the last one, but that
>>> would add some cycles there, partially negating any benefit. Instead
>>> I propose that we reverse the direction of the search loop, as attached.
>
>> Well, the reason why the array is only 64 bytes in size is to make
>> sure that searching the whole thing is really fast. We figure we're
>> going to have to do that often, so it needs to be cheap. If it's not,
>> we're hosed already, I think.
>
> I actually suspect the bitmask manipulations cost more than the touches
> of fpRelId[]. I agree that there's no reason to think that this area
> needs really tense micro-optimization, but if we can get some savings for
> zero added cost/complexity, why not?
Sure.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2013-11-28 19:28:23 | Re: ERROR during end-of-xact/FATAL |
Previous Message | Robert Haas | 2013-11-28 19:24:45 | Re: Marginal performance improvement for fast-path locking |