Re: profiling connection overhead - Mailing list pgsql-hackers

From Robert Haas
Subject Re: profiling connection overhead
Date
Msg-id AANLkTinLXOrut35=uNA1fUD7Oo1mVTbO1apCKgJXwhpd@mail.gmail.com
Whole thread Raw
In response to Re: profiling connection overhead  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: profiling connection overhead
List pgsql-hackers
On Wed, Nov 24, 2010 at 10:25 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> The first optimization that occurred to me was "remove the loop
>> altogether".
>
> Or make it execute only in assert-enabled mode, perhaps.
>
> This check had some use back in the bad old days, but the ResourceOwner
> mechanism has probably removed a lot of the argument for it.

Yeah, that's what I was thinking - this could would have been a good
backstop when our cleanup mechanisms were not as robust as they seem
to be today.  But making the check execute only in assert-enabled more
doesn't seem right, since the check actually acts to mask other coding
errors, rather than reveal them.  Maybe we replace the check with one
that only occurs in an Assert-enabled build and just loops through and
does Assert(PrivateRefCount[i] == 0).  I'm not sure exactly where this
gets called in the shutdown sequence, though - is it sensible to
Assert() here?

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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Suggested "easy" TODO: pg_dump --from-list
Next
From: Tom Lane
Date:
Subject: Re: profiling connection overhead