I'm getting 11x speed penalty if I'm doing denoise_tv_chambolle on 64 bit floats instead on 32 bit. Is this normal and expected?
import numpy as np
from skimage import img_as_float
from skimage.restoration import denoise_tv_chambolle
arr=np.random.normal(size=(75,75)).clip(-1.0,1.0)
imgfp32=img_as_float(arr).astype(np.float32)
imgfp64=img_as_float(arr).astype(np.float64)
%timeit denoise_tv_chambolle(imgfp32, weight=0.12, multichannel=False)
%timeit denoise_tv_chambolle(imgfp64, weight=0.12, multichannel=False)
gives me
2.11 ms ± 10.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
23.3 ms ± 32.3 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
Thanks
[If reporting a bug, attach the entire traceback from Python.]
[If proposing an enhancement/new feature, provide links to related articles, reference examples, etc.]
[If reporting a bug, please include the following important information:]
skimage.__version__)What version of scikit-image and numpy are you using? That function uses only fairly basic numpy operations so performance should be largely determined by the underlying numpy library performance.
On current master I get only slightly slower performance for float64 in line with what one might expect:
2.55 ms ± 282 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
3.16 ms ± 3.16 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
I have numpy 1.13.1 from conda-forge (it is built using OpenBLAS)
Thanks @grlee77
My other PC shows behaviour similar to yours. I'll dig deeper into this. I use gohlke's repository for MKL numpy and scikit image
www.lfd.uci.edu/~gohlke/pythonlibs/
Using numpy+mkl and skimage from https://www.lfd.uci.edu/~gohlke/pythonlibs/:
1.17 ms ± 5.67 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
1.7 ms ± 3.49 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
OMG! Christoph! Is that you? You are my hero! Your repository is my number one place to install python libraries.
Also, you have a pretty fast PC.
I reinstalled everything from the repository and the problem has gone.