+#!./.venv/bin/python
+
+import numpy as np
+import matplotlib.pyplot as plt
+import time
+import math
+import pyfftw
+
+def test(func, length):
+ results = []
+ for i in range(100):
+ a = np.random.randint(0, 255, (1, length, 3), dtype=np.uint8)
+ t = time.time()
+ r = func(a)
+ results += [time.time() - t]
+
+ return sum(results) / len(results)
+
+def f1(a):
+ a = np.fft.fft(a)
+ a = np.fft.ifft(a)
+
+def f2(a):
+ a = pyfftw.interfaces.numpy_fft.fft(a)
+ a = pyfftw.interfaces.numpy_fft.ifft(a)
+
+lengths = list(range(70, 1000000, 10000))
+
+print(len(lengths))
+f1_results = [test(f1, i) for i in lengths]
+f2_results = [test(f2, i) for i in lengths]
+fig, (ax0, ax1) = plt.subplots(2, 1, layout='constrained')
+
+ax0.plot(f1_results, lengths, "-b", label="numpy")
+ax0.plot(f2_results, lengths, "-r", label="ptfftw")
+ax0.set_xlabel('Time (ms)')
+ax0.set_ylabel('Array length')
+ax0.legend(loc="upper left")
+
+ax1.plot(100 - ((np.array(f2_results) / np.array(f1_results)) * 100), lengths, "-g")
+ax1.set_xlabel('Speed-up (%)')
+ax1.set_ylabel('Array length')
+
+plt.show()