help-octave
[Top][All Lists]
Advanced

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

strange FFT timing


From: Przemek Klosowski
Subject: strange FFT timing
Date: Sun, 20 Apr 2008 14:05:18 -0400

 I would expect that FFT would be fasterst for datasets of the size
that is a power of 2, but a quick test doesn't bear this out. I am
using Octave Version 3.0.0 on Fedora 8 (2.6.24) runing on a 2.1 GHz
Athlon XP 2800+ with 1GB of memory (no swap activity during the
calculation). The 1,000,000 element FFT is almost twice as fast as
2^20 element FFT (see below for excerpt of the Octave session).

Anyone would venture what is going on? It could be cache aliasing
(this Athlon has a 512kB cache). In any case, FFTW seems to be very
good handling the non-power-of-2 sizes, and seems
to be optimized for power-of-ten sizes.

v=rand(2^20,1);  tic;fft(v);toc
Elapsed time is 0.339144 seconds.
Elapsed time is 0.290032 seconds.
Elapsed time is 0.283474 seconds.
Elapsed time is 0.291376 seconds.
Elapsed time is 0.285946 seconds.
v=rand(1e6,1);   tic;fft(v);toc
Elapsed time is 0.223884 seconds.
Elapsed time is 0.179272 seconds.
Elapsed time is 0.179442 seconds.
Elapsed time is 0.184591 seconds.
Elapsed time is 0.179012 seconds.

Similar results obtained with  v=rand(1e6,1);x=cputime;fft(v);cputime-x


reply via email to

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