Re: Performance degradation in commit ac1d794 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Performance degradation in commit ac1d794
Date
Msg-id CA+TgmoZtYZjrQCCc9cOFSuB1=1VOcBOgvfFSJ4UObTFgyc1V8Q@mail.gmail.com
Whole thread Raw
In response to Re: Performance degradation in commit ac1d794  (Andres Freund <andres@anarazel.de>)
Responses Re: Performance degradation in commit ac1d794
List pgsql-hackers
On Fri, Mar 18, 2016 at 1:53 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2016-03-18 05:56:41 -0400, Robert Haas wrote:
>> >> 0 at the top of the loop and skip it forthwith if so.
>> >
>> > You mean in WaitEventSetWait()? There's
>> >                 else if (rc == 0)
>> >                 {
>> >                         break;
>> >                 }
>> > which is the timeout case. There should never be any other case of
>> >                 returning 0 elements?
>>
>> No, I meant if (cur_event->events == 0) continue;
>
> I'm not following. Why would there be an event without an empty event
> mask? Ok, you can disable all notifications for a socket using
> ModifyWaitEvent(), but that's not particularly common, right?  At least
> for epoll, it'd not play a role anyway, since epoll_wait() will actually
> return pointers to the elements we're waiting on; for windows we get the
> offset in ->handles.  I guess we could do so in the select/poll case,
> but adding another if for something infrequent doesn't strike me as a
> great benefit.

No, I mean it should be quite common for a particular fd to have no
events reported.  If we're polling on 100 fds and 1 of them is active
and the other 99 are just sitting there, we want to skip over the
other 99 as quickly as possible.

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Next
From: Michael Paquier
Date:
Subject: Re: Password identifiers, protocol aging and SCRAM protocol