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

Speeding up with Numexpr #5

Open
wilko339 opened this issue May 31, 2020 · 2 comments
Open

Speeding up with Numexpr #5

wilko339 opened this issue May 31, 2020 · 2 comments

Comments

@wilko339
Copy link

wilko339 commented May 31, 2020

Hi Pierre,

I love this generator, its working great for me! However, I would like to be able to use this to generate arrays with minimum of 300 elements in each dimension and it's quite slow at the moment. Have you ever heard of the Numexpr package? It's able to perform basic operations on large arrays much faster than NumPy. Maybe this would be able to reduce the time taken to run your generator?

For example, your 'f(t)' function (line5) could be written using Numexpr as follows:

import numexpr as ne

def f(t):
return ne.evaluate('6t**5 - 15t4 + 10*t3')

This will massively reduce the time. Just a suggestion for you!

@SteffenCzolbe
Copy link

I share the speed concern. Im working with large 3d arrays, and this library just doesn't cut it for that.
The suggested expression using numexpr doesn't speed up the code by much though -- I see about a 5% speedup.

@pvigier
Copy link
Owner

pvigier commented Apr 20, 2022

Hi,
I don't think we can win much performance using only Python and numpy and I don't plan to use another dependency for this library.
Have you tried to use numba as proposed in issue #9? andrekv17 reported an important performance gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants