Re: Spinlock backoff algorithm - Mailing list pgsql-hackers

From Steve Atkins
Subject Re: Spinlock backoff algorithm
Date
Msg-id 78E5748A-C1A0-4C3A-9CC6-AC5B34E1AEDD@blighty.com
Whole thread Raw
In response to Re: Spinlock backoff algorithm  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Nov 14, 2007, at 6:57 PM, Josh Berkus wrote:

> Tom,
>
>> I've got one upstairs (HPPA), and I believe that it's actually a  
>> pretty
>> common situation in scientifically-oriented workstations from a few
>> years back.
>
> Last I checked, scientific workstations aren't exactly a common  
> platform for
> PostgreSQL servers.
>
> The question is, for our most common platforms (like AMD and Intel)  
> is the FPU
> notably slower/more contended than integer division?  I'd the  
> impression that
> it was, but my knowledge of chip architectures is liable to be out  
> of date.
>
> Can we have a hardware geek speak up?

Somewhat. The last version of K7 I looked at had three integer  
execution units versus one floating point unit.

They're also scheduled fairly independently, meaning that casts from  
double to integer or back again will have some minor negative effects  
on the pipeline or the scheduler more than the use of floating point  
itself.

In the grand scheme of things, though, I don't believe it's a big  
deal for typical code on most modern desktop CPUs, certainly not  
compared to memory starvation, use of less than optimal compilers and  
all the other reasons the pipeline might stall. I might care in the  
innermost of inner loops, but possibly not even then unless a  
profiler told me differently.

Cheers,  Steve



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Spinlock backoff algorithm
Next
From: "Gregory Maxwell"
Date:
Subject: Re: Spinlock backoff algorithm