Skip to content
Prev 258608 / 398502 Next

strange fluctuations in system.time with kernapply

On 29.04.2011 23:38, Alexander Senger wrote:
The magic is that the length of the vector, 1110308, is inefficient for 
the fft() used within kernapply(). You need integer powers of 2 for a 
really fast FFT.

You can also try smaller numbers  to get longer runtimes, e.g.: 100003

As an example, compare:

system.time(fft(rep(1, 32768))) # roughly 0 seconds
system.time(fft(rep(1, 32771))) # almost 10 seconds

Uwe Ligges