On Tue, 12 Mar 2024 11:34:40 -0000
via NumPy-Discussion <numpy-discussion@python.org> wrote:

> https://github.com/2D-FFT-Project/2d-fft/blob/main/notebooks/comparisons.ipynb

Hi,

Since you are using a notebook to perform the benchmark, I would advise you to 
use:
```
timing = %timeit -o some_function(*args)
```

Because you are using the `time.time()` function which is not very
precise. `time.perf_counter()` would be better but `timeit` is the best.
Also, it allows to run for longer thus more stable values (let the
speed of the CPU stabilize).

That said, I did not measure your code faster than numpy or scipy
implementations ... despite you are using some "un-advisable" practices
like "-O3" and "--fast-math" by default.

This brings me back 20 years in time when I played with the Intel
compiler, which was much faster (~ +20% vs gcc) for each iteration but
surprisingly it needed also +50% in the number of iteration to achieve
a given precision. I remember loosing 6 month of work because of these
options. One should only activate those options on a limited piece of
code where it is known to be NOT harmful.

Cheers,
-- 
Jérôme Kieffer
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to