Created
May 18, 2018 11:54
-
-
Save Debilski/b6b4bedd3e88fdcfa0987dd46babb356 to your computer and use it in GitHub Desktop.
Intel distribution for Python benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import numpy as np | |
import numpy.random as rn | |
def fftbench(size): | |
mat = rn.rand(size, size) + 1j * rn.randn(size, size) | |
start = time.time() | |
# 2D transform on a complex-valued matrix: | |
result = np.fft.fft2(mat) | |
end = time.time() | |
print(size, end - start) | |
if __name__ == '__main__': | |
for size in sys.argv[1:]: | |
fftbench(int(size)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic anaconda | |
python fftbench.py 1 10 100 1000 5000 7000 10000 15000 > basic-anaconda | |
# install intel-enhanced anaconda in a new environment | |
conda config --add channels intel | |
conda create --name intelpy intelpython3_full python=3 | |
conda activate intelpy | |
python fftbench.py 1 10 100 1000 5000 7000 10000 15000 > intel-anaconda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This implements the benchmark from https://www.infoworld.com/article/3187484/software/how-does-a-20x-speed-up-in-python-grab-you.html