-
Notifications
You must be signed in to change notification settings - Fork 1
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
Barnes hut algorithm is way too slow #6
Comments
Did you change the value of theta? Because when theta = 0, Barnes' hut has the same time complexity as the brute force algorithm. |
I simply used the barnes_square_grid example with large number of particles. The complexity is the same but there's a lot of data copying, thats what I think is making it slower. |
I don't really think data copying is the culprit here and a huge amount of time can be saved by simply changing the isChild function. I'll benchmark it with the changes and see if it does make a difference though. IMO, the benchmark is not that bad even right now. Because -
|
You're right. It takes only about 0.014 secs out of 45 for copying data to list. |
BTW, you should probably change |
Sure thing. |
Also rename |
Timings for the following benchmark,
which is way too slow. We could probably speed it up by avoiding copying the entire dataset to a list.
We could instead try to store the indices in a list and access the properties using the pointers itself.
Also passing 3 values by reference to the functions returning
Vec3
could also help a bit.This might hurt readability a bit, but once we get it working, I think we should make these optimizations
before the release.
The text was updated successfully, but these errors were encountered: