-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ufunc.at (and possibly other methods) slow #11156
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
Comments
is the graph generated by https://github.com/nschloe/fastfunc/blob/master/test/performance.py ? |
Yup. |
We can leave this open, #5922 seems like a duplicate. I am surprised I did not create an issue the day we merged it, harharhar. Somewhere hidden in the depths there are some pointers how to make it at least a small factor faster (making it much faster is more involved, using a faster hook into the fancy indexing machinery and requiring to special different cases). EDIT: One thing is that it uses utterly insane (and possibly unnecessary) slow stuff for casting (unless it was removed). But another factor that is that there is no inner loop specialization IIRC (i.e. the very old advanced indexing api). I admit, the first part may have been avoided if I had been more familiar with that stuff at the time of reviewing it... But basically we always knew it was not fast :/. (to my defence I said something like: dunno, this might be an option ;)) |
Here I explained what makes
|
It would be great if we could start using C++ template instead of the |
In
This could perhaps be generalized; for now I just wanted to create a show case.
Well, then perhaps +, -, *, / should be treated differently than custom functions? |
Yes, all the common things like Not sure if you saw numpy-groupies already. If using |
There was a discussion back in the 2010-2011 time frame about moving to C++. I'm not so much bothered by the current templates, but having smart pointers and error handling would be a big +. The downside is that writing good C++ code takes a lot of expertise and the compiler error messages, especially of templates, are practically indecipherable. There would also be a need for keyword variable name cleanup, things like variables named |
Duplicate of #5922 |
Closing #23136 was merged. |
I noticed that in many of my codes, seemingly harmless lines like
take a large share of the runtime. I investigated and found that one gets a speed-up of a factor of 40 (!) by simply moving the critical code to C++.
(Not sure what's actually done in
numpy.ufunc
.) I put this into a very simple module, https://github.com/nschloe/fastfunc, so feel free to take some code out of there.The text was updated successfully, but these errors were encountered: