-
Notifications
You must be signed in to change notification settings - Fork 131
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
Is numba worth the trouble if numpy can do most of the work? #23
Comments
OK, I have numba working on I have more work to do before I merge this into master, but for this is the speedup so far: numba-dan branch: on master: |
Figures above had memorization code removed. The times are better with memoization reinstated, so masks are only generated once. numba-dan with memoization turned on |
Feature tests, fixes, and performance boosts.
Yes, numba (or cython, etc.) is worth the trouble! :) At least when you're tracking a flowing material made of close-packed particles, which really taxes the subnet code. Switching the subnet code to numba gave me roughly an order of magnitude in speed for my data. I have battled numba before, so if you are running into problems, I may be able to help. Also, now that you have the numba code running and passing tests, there may be ways to speed it up. As in Cython, it's possible for the code to silently drop back into the Python object model, which means a huge penalty. I have re-forked the master branch of this repo and will probably add the numba subnet code soon. I don't mean to be impatient --- I just have to add a feature to the linker for my research, and I thought I'd try to quit my old numba branch, which means that I need comparable performance from the new one soon. I'm so glad that |
Great! Once I have something that I'm sure is working, I'll ask for your help. Maybe later today if things go well. Don't worry about seeming impatient -- I was worried about seeming that way myself. I'd like to have something stable to work on soon. I think what remains is:
Anything else on our collective wish list before declare victory on v0.2 and start using it full time? |
We have our numba subnet. #44 paves the way for a drop-in replacement or 2D special case for refine, whether it numba, cython, or C. Since Nathan has indicated that his needs are met in runtrackpy, I will close this issue. |
This S.O. question, in particular the original poster's comment on the answer, sums up my feelings as I try work fit numba into my code. Seems like a lot of common numpy idioms are not supported.
Explicit loops, which seem to be what numba wants, make code less readable and obviously slower for users who might not have numba available. Disappointing.
On the other hand, the line profiler %lprun shows me that the
refine
function in feautre.py takes 95% of the runtime during feature location, so making that faster is worth the trouble, even if it does take a lot of trouble.Thoughts?
The text was updated successfully, but these errors were encountered: