Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about performance of typed containers from the interpreter. #6440

Merged
merged 3 commits into from Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/source/user/faq.rst
Expand Up @@ -102,8 +102,8 @@ Does Numba vectorize array computations (SIMD)?
Numba doesn't implement such optimizations by itself, but it lets LLVM
apply them.

Why my loop is not vectorized?
------------------------------
Why has my loop not vectorized?
-------------------------------

Numba enables the loop-vectorize optimization in LLVM by default.
While it is a powerful optimization, not all loops are applicable.
Expand Down Expand Up @@ -150,6 +150,16 @@ In this case, vectorization is rejected because the vectorized code may behave
differently. This is a case to try turning on ``fastmath=True`` to allow
fastmath instructions.

Why are the ``typed`` containers slower when used from the interpreter?
-----------------------------------------------------------------------

The Numba ``typed`` containers found in ``numba.typed`` e.g.
``numba.typed.List`` store their data in an efficient form for access from JIT
compiled code. When these containers are used from the CPython interpreter, the
stuartarchibald marked this conversation as resolved.
Show resolved Hide resolved
data involved has to be converted from/to the container format. This process is
relatively costly and as a result impacts performance. In JIT compiled code no
such penalty exists and so operations on the containers are much quicker and
often faster than the pure Python equivalent.

Does Numba automatically parallelize code?
------------------------------------------
Expand Down