Re: Marginal performance improvement for fast-path locking
От | Tom Lane |
---|---|
Тема | Re: Marginal performance improvement for fast-path locking |
Дата | |
Msg-id | 16685.1385666601@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Marginal performance improvement for fast-path locking (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Marginal performance improvement for fast-path locking
|
Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes: > On Thu, Nov 28, 2013 at 1:46 PM, Tom Lane <tgl@sss.pgh.pa.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? regards, tom lane
В списке pgsql-hackers по дате отправления: