fftconvolve
fftconvolve copied to clipboard
Choosing optimal arrays size
What array size to choose? I understand, that it should be a power of 2, but it seems otherwise, eg. somewhat random, with huge fps drops across values...
Hey!
My understanding is that powers of 2 should be the most efficient as well, but maybe that isn't quite the case. Could you send through some examples, please?
Cheers, Rhys
I think the padding that happens internally in the fftconvolve function should probably pad to a power of 2, and that isn't happening correctly. It would still be helpful if you send me through some examples, and I'll benchmark them and see if I can speed it up with proper padding
Ok, I'm creating lenia program ( floating point version of "game of life" ). Because of that, one array is big, and one is small, so here are exaples: in1, in2; time[ms]
- 1048_576, 1681; 54
- 1048_576, 1521; 69
- 1048_576, 1369; 65 At first sorry, after deeper investigation it seem, like power of 2 is in fact better ( in1 ). However, why in2 size changes have such big influence on overall time? I can't make it array a power of 2 ( there must be center point ), but I just don't understand why making it smaller could make calculations longer...
Ps. code is on my github (lenia), if you want look at it.