Another thing to verify in your tests is whether or not the compiler was able to fully translate the function to nopython mode. You can add the nopython=True option to the @jit decorator to raise an exception if nopython mode was not possible.
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users+unsubscribe@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/25c5dddc-83e2-4dda-ba6a-183519d5c967%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
Numba will be a benefit for functions with the following characteristics:
- Run time is primarily due to NumPy array element memory access or numerical operations (integer or float) more complex than a single NumPy function call.
- Functions which work with data types that are frequently converted by NumPy functions to int64 or float64 for calculations (like int8 and int16).
- The function is called many times during normal execution. Compilation is slow, so if the function is not called more than once, the execution time savings is unlikely to compensate for compilation time.
- The function execution time is larger than the Numba dispatcher overhead. Functions which execute in much less than a microsecond are not going to see a major improvement, as the wrapper code which transitions from the Python interpreter to Numba takes longer than a pure Python function call.
Another thing to verify in your tests is whether or not the compiler was able to fully translate the function to nopython mode. You can add the nopython=True option to the @jit decorator to raise an exception if nopython mode was not possible.
On Sun, Dec 11, 2016 at 9:21 AM, <jiedon...@gmail.com> wrote:
I am new to Numba and have read some blogs about accelerating python code using Numba. I tried the example from the homepage of numba.But I find that actually, without using the @jit decorator, the script runs faster. I tried several arrays with different sizes. In all cases, the plainfunction without using numba is faster to run.So my question is, under what situation is using numba actually better than using the plain function.
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/25c5dddc-83e2-4dda-ba6a-183519d5c967%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To post to this group, send email to numba...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/CADv3RKQuK5e8xc6nzKfea2AUfzs85WTNbyxZt8-WuyLC7CGi4g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users+unsubscribe@continuum.io.