-
Notifications
You must be signed in to change notification settings - Fork 4
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
Minimize array creation #71
Comments
An alternative to changing everything to in-place operations could be to introduce numba or cython. This would mean that kernels get compiled and that we have to ship platform-specific wheels, but it would take care of optimizing buffer reuse, reducing the overhead from crossing the C-Python boundary between numpy calls, and can optionally release the GIL during kernel execution. The last point is interesting, because - if done right - it synergizes with asyncio and python's multi-threading primitives to allow multi-threaded computation that can run in parallel to the interpreter (i.e., you can sidestep the GIL with it). |
Let's cross out Numba right away, if we go that path it will be Cython. (Numba as a runtime dependency is not an option due to the compiler requirement, and their AOT story is very poorly supported) |
A few functions have received this treatment in recent PRs, such as |
As an extension to pygfx/pygfx#520 we can optimize pylinalg functions by minimizing (temporary) array creation, reducing time spent in memory allocation and garbage collection.
This will have bigger impact when the functions are used on arrays of inputs.
The text was updated successfully, but these errors were encountered: