Re: Idea for cleaner representation of snapshots

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Idea for cleaner representation of snapshots
Date: 2007-03-24 21:37:07
Message-ID: 87y7lm4930.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> HeapTupleSatisfiesVisibility reduces to something like
>
> ((*(snapshot)->satisfies) ((tuple)->t_data, snapshot, buffer))
>
> which ought to be faster than it is now.
It sounds like a fine idea from the point of view of flexibility. But as far
as faster... I guess it depends on how often HeapTupleSatisfiesVisibility is
used in contexts where the compiler is able to optimize away the conditionals
or the cpu is able to predict them accurately. I suspect in the cases where we
actually care--scans where it's being called thousands of times quickly--the
latter is quite effective.
Function pointers are notoriously hard to optimize around and can actually
make the surrounding code harder to optimize as well especially since we
compile with -fno-strict-aliasing. So whether it's faster or slower may depend
a lot on the specific call site.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message stark 2007-03-24 22:14:07 datestyle GUC broken in HEAD?
Previous Message Tom Lane 2007-03-24 21:15:05 Re: Idea for cleaner representation of snapshots