Re: Terrible FPU performance

2011-04-27 Thread David Cournapeau
On Wed, Apr 27, 2011 at 10:04 PM, Mihai Badoiu wrote: > I'm using intel xeon harpertown (E5450) and Python 2.6.4. > In the cython code, when I use fpclassify, in the slow case I get 3 > (FP_SUBNORMAL) > In the pure-C code, when I use fpclassify, in the case that's supposed to be > slow but it's no

Re: Terrible FPU performance

2011-04-27 Thread Mihai Badoiu
I'm using intel xeon harpertown (E5450) and Python 2.6.4. In the cython code, when I use fpclassify, in the slow case I get 3 (FP_SUBNORMAL) In the pure-C code, when I use fpclassify, in the case that's supposed to be slow but it's not, I get a 2 (FP_ZERO) Somehow, the FPU's have different result

Re: Terrible FPU performance

2011-04-26 Thread Ben Finney
Alec Taylor writes: > What's an FPU? Wikipedia not working for you today? :-) http://en.wikipedia.org/wiki/Floating-point_unit> I take it as a promising sign that computer-savvy people don't need to know the term anymore, since FPUs have long been integrated parts of the CPU on most computers.

Re: Terrible FPU performance

2011-04-26 Thread rusi
On Apr 27, 10:11 am, Alec Taylor wrote: > What's an FPU? http://lmgtfy.com/?q=fpu -- http://mail.python.org/mailman/listinfo/python-list

Re: Terrible FPU performance

2011-04-26 Thread Chris Angelico
On Wed, Apr 27, 2011 at 3:11 PM, Alec Taylor wrote: > What's an FPU? Floating Point Unit, the part of your computer's processor that handles floating-point mathematics. Integer calculations are done in the main CPU, but the FPU (which these days is part of the same hunk of silicon, but used to be

Re: Terrible FPU performance

2011-04-26 Thread Alec Taylor
What's an FPU? On Tue, Apr 26, 2011 at 11:40 PM, Mihai Badoiu wrote: > Hi, > I have terrible performance for multiplication when one number gets very > close to zero.  I'm using cython by writing the following code: >     cdef int i >     cdef double x = 1.0 >     for 0 <= i < 1000: >        

Re: Terrible FPU performance

2011-04-26 Thread David Cournapeau
On Wed, Apr 27, 2011 at 4:14 AM, Dan Goodman wrote: > Hi, > > On 26/04/2011 15:40, Mihai Badoiu wrote: >> I have terrible performance for multiplication when one number gets very >> close to zero.  I'm using cython by writing the following code: > > This might be an issue with denormal numbers: >

Re: Terrible FPU performance

2011-04-26 Thread Terry Reedy
On 4/26/2011 3:27 PM, Dan Stromberg wrote: for 0<= i< 1000: x *= 0.8 #x += 0.01 print x In my WinXP (Athlon), 3.2 standard install x=1.0 print(x) for i in range(1000): x *= 0.8 x += 0.01 print(x) takes about 3 1/2 secs with addition comment

Re: Terrible FPU performance

2011-04-26 Thread Dan Stromberg
On Tue, Apr 26, 2011 at 6:40 AM, Mihai Badoiu wrote: > Hi, > I have terrible performance for multiplication when one number gets very > close to zero.  I'm using cython by writing the following code: >     cdef int i >     cdef double x = 1.0 >     for 0 <= i < 1000: >         x *= 0.8 >      

Re: Terrible FPU performance

2011-04-26 Thread Mihai Badoiu
Yes, running on pure python has the same issue (but overall only a factor 3 away): i = 0 x = 1.0 while i < 1000: x *= 0.8 #x += 0.01 i += 1 print x On Tue, Apr 26, 2011 at 1:44 PM, Philip Semanchuk wrote: > > On Apr 26, 2011, at 1:34 PM, Mihai Badoiu wrote: > > > Already did. T

Re: Terrible FPU performance

2011-04-26 Thread Dan Goodman
Hi, On 26/04/2011 15:40, Mihai Badoiu wrote: > I have terrible performance for multiplication when one number gets very > close to zero. I'm using cython by writing the following code: This might be an issue with denormal numbers: http://en.wikipedia.org/wiki/Denormal_number I don't know much

Re: Terrible FPU performance

2011-04-26 Thread Philip Semanchuk
On Apr 26, 2011, at 1:34 PM, Mihai Badoiu wrote: > Already did. They suggested the python list, because the asm generated code > is really correct and the problem might be with the python running on top. Does the same timing in consistency appear when you use pure Python? bye Philip > > On

Re: Terrible FPU performance

2011-04-26 Thread Mihai Badoiu
Already did. They suggested the python list, because the asm generated code is really correct and the problem might be with the python running on top. On Tue, Apr 26, 2011 at 1:04 PM, Chris Colbert wrote: > > > On Tue, Apr 26, 2011 at 8:40 AM, Mihai Badoiu wrote: > >> Hi, >> >> I have terrible

Re: Terrible FPU performance

2011-04-26 Thread Chris Colbert
On Tue, Apr 26, 2011 at 8:40 AM, Mihai Badoiu wrote: > Hi, > > I have terrible performance for multiplication when one number gets very > close to zero. I'm using cython by writing the following code: > > You should ask this question on the Cython users mailing list. -- http://mail.python.org/m

Terrible FPU performance

2011-04-26 Thread Mihai Badoiu
Hi, I have terrible performance for multiplication when one number gets very close to zero. I'm using cython by writing the following code: cdef int i cdef double x = 1.0 for 0 <= i < 1000: x *= 0.8 #x += 0.01 print x This code runs much much slower (20+ time