From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Gregory Stark <stark(at)enterprisedb(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: Idea for cleaner representation of snapshots |
Date: | 2007-03-25 11:09:11 |
Message-ID: | 20070325110911.GA26048@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Mar 24, 2007 at 09:37:07PM +0000, Gregory Stark wrote:
> 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.
Dunno, this test by someone suggests that calling through a function
pointer doesn't cost anything at all, if anything it's faster. Though
that may differ on other machines obviously.
http://gcc.gnu.org/ml/gcc/2004-06/msg01308.html
In any case, looking at the code I don't think the compiler can
optimise HeapTupleSatisfiesVisibility at all ever, because it's never
specified explicitly.
> 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.
The costs of -fno-strict-aliasing are probably measurable, but I don't
think we can do anything about that...
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Gregory Stark | 2007-03-25 12:31:21 | Re: Idea for cleaner representation of snapshots |
Previous Message | Joshua D. Drake | 2007-03-25 03:47:39 | Re: Copyrights on files |