This repository contains benchmarking results for Numba with NumPy.
We conducted benchmark tests to evaluate the performance of Numba when using NumPy compared to using raw loops.
Numbaversion:0.57.1Numpyversion:1.24.4Pythonversion:3.11.4ROOTversion:6.29/01- Each test was run
10times and an average of the execution time was calculated. - The tests were run on a
linux fedora 38station.
This figure represents the results of our benchmarking for real-time performance. The x-axis represents the number of threads, and the y-axis represents the average real-time execution in seconds.
Some observations:
-
As the number of threads increases, there is a noticeable decrease in average real-time execution for both the
loopandNumpyimplementations. This suggests thatNumba, when combined withNumPy, can take advantage of multi-threading and scale with the number of threads. -
The
loopimplementation consistently outperforms theNumpyimplementation as the number of threads increases.
This figure illustrates the speedup factor when using Numba with NumPy compared to the loop implementation. The x-axis represents the number of threads, and the y-axis represents the speedup factor.
Some observations:
-
The speedup factor indicates how much faster the
Numbawith bothNumPyandloopimplementations are.Numbahad issues with this in the past versions and the scaling wasn't as expected when usingNumpy. -
As observed in the figure, the speedup factor increases with the number of threads. For a higher number of threads,
8in this example, the speedup factor reaches a value of6.6. This confirms thatNumbawithNumPyscaleslinearlywith the number of threads, similarily to how theloopimplementation scales.

