help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NaN slowdown with some processors


From: Marc Normandin
Subject: Re: NaN slowdown with some processors
Date: Wed, 04 Jun 2008 03:47:16 -0400
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

Hi Olli,

Olli Saarela wrote:
> Hello,
> 
> I'm planning to buy a new desktop machine, and since my computations
> utilize NaN values heavily, I'd like to know whether Intel Core 2
> processors suffer from the same slowdown with NaN values as Pentium. For
> details, see http://www.cygnus-software.com/papers/x86andinfinity.html
> 
> If someone has Octave on a machine with a Core 2 processor, please run
> the following commands and tell the results. (Or a more detailed test
> from ftp://ftp.cygnus-software.com/pub/specialnumbers.zip)
> 
>      a=zeros(300,300);tic;b=(1.0+a)*a;toc
>      a=zeros(300,300);tic;b=(NaN+a)*a;toc
> 
> Below are results from my current machines. Since SSE2 in Pentium isn't
> affected with the slowdown, it seems that for some reason the commands
> above don't utilize SSE2. AMD processors aren't affected.
> 
> Pentium M, Octave 3.0.1 MSVC2005 SSE2
>      octave-3.0.1.exe:8> a=zeros(300,300);tic;b=(1.0+a)*a;toc
>      Elapsed time is 0.0430298 seconds.
>      octave-3.0.1.exe:9> a=zeros(300,300);tic;b=(NaN+a)*a;toc
>      Elapsed time is 28.8307 seconds.
> 
> Pentium 4 (Family 15, Model 2), Octave 3.0.1 MSVC2005 SSE2
>      octave-3.0.1.exe:2> a=zeros(300,300);tic;b=(1.0+a)*a;toc
>      Elapsed time is 0.0257161 seconds.
>      octave-3.0.1.exe:3> a=zeros(300,300);tic;b=(NaN+a)*a;toc
>      Elapsed time is 15.7125 seconds.
> 
> AMD Turion 64 X2, Octave 3.0.1 MSVC2008 SSE3
>      octave-3.0.1.exe:3> a=zeros(300,300);tic;b=(1.0+a)*a;toc
>      Elapsed time is 0.0244939 seconds.
>      octave-3.0.1.exe:4> a=zeros(300,300);tic;b=(NaN+a)*a;toc
>      Elapsed time is 0.0251131 seconds.
> 
> Thank you,
>    Olli
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave

I can't help you with testing on a Core 2 box as I don't have ready
access to one, but I tried to replicate your test on my Pentium 4
desktop and Pentium M laptop.  I also experienced a performance hit on
NaN operations (about 20-fold on Pentium 4 and 10-fold on Pentium M),
but not nearly as dramatic as what you encountered on your Intel
machines (about 600-fold on both processors).

Here's the output from my desktop (Octave 3.0.1 on Debian Etch), each
command run in triplicate plus system information:

octave:1> pkg unload nan
octave:2> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.0552131 seconds.
octave:3> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.0539919 seconds.
octave:4> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.051563 seconds.
octave:5> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 1.12489 seconds.
octave:6> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 1.12665 seconds.
octave:7> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 1.12564 seconds.
octave:8> ver
----------------------------------------------------------------------
GNU Octave Version 3.0.1
GNU Octave License: GNU General Public License
Operating System: Linux 2.6.18-6-686 #1 SMP Sat May 24 10:24:42 UTC 2008
i686
----------------------------------------------------------------------
octave:9> system ('cat /proc/cpuinfo')
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping        : 4
cpu MHz         : 2391.210
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm up
bogomips        : 4786.63


FWIW, processing times were essentially identical whether Octave-Forge
NaN package was unloaded or not.

And here's the output from my laptop (Octave 3.0.0 on Ubuntu 8.04,
Octave-Forge NaN package not installed on this machine):

octave:1> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.00390399 seconds.
octave:2> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.00307489 seconds.
octave:3> a=zeros(300,300);tic;b=(1.0+a)*a;toc
Elapsed time is 0.00536211 seconds.
octave:4> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 0.0299039 seconds.
octave:5> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 0.0355789 seconds.
octave:6> a=zeros(300,300);tic;b=(NaN+a)*a;toc
Elapsed time is 0.0551061 seconds.
octave:7> ver
----------------------------------------------------------------------
GNU Octave Version 3.0.0
GNU Octave License: GNU General Public License
Operating System: Linux 2.6.24-18-generic #1 SMP Wed May 28 20:27:26 UTC
2008 i686
----------------------------------------------------------------------
octave:8> system ('cat /proc/cpuinfo')
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.50GHz
stepping        : 8
cpu MHz         : 600.000
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts est tm2
bogomips        : 1198.41
clflush size    : 64


Not sure what might explain the big differences we saw in performance
loss.  I'm unqualified to speculate, but I'll do so anyhow: Is it
possible that the slowdown is somehow exacerbated by an MSVC compile?

Best regards,
Marc

-- 
------------------------------------------------------------------
Marc D. Normandin              http://web.ics.purdue.edu/~mdnorman
Graduate Research Assistant                     address@hidden
Indiana University School of Medicine           317-278-9841 (tel)
Department of Radiology, Division of Research   317-274-1067 (fax)
------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]