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

Speed improvements to `gravmag.tesseroid` #58

Merged
merged 16 commits into from Sep 19, 2013

Conversation

Projects
None yet
1 participant
@leouieda
Member

leouieda commented Sep 10, 2013

Moved some things over to Cython, precomputing sines and cossines, using buffers to avoid malloc in loops and removed most numpy array fancy indexing.
Comparing to Tesseroids (written in C):

  • 2x slower for 2deg tesseroids at 50km
  • 10% faster for 1deg tesseroids at 50km
  • 1.75x faster for 1deg tesseroids at 250km
  • 2x faster for 2deg tesseroids at 250km

Current bottlenecks are:

  1. Calculating distances
  2. Separating for which computation points I need to divide the tesseroid

So it seems that, if I need to split he tesseroid a lot, then the Python code is really slow.
But in cases that I have computation at least 1x size of tesseroid away, the Python code is much faster the C.

leouieda added a commit that referenced this pull request Sep 19, 2013

Merge pull request #58 from leouieda/tesseroid
Speed improvements to `gravmag.tesseroid`

@leouieda leouieda merged commit 870e59c into master Sep 19, 2013

1 check passed

default The Travis CI build passed
Details

@leouieda leouieda deleted the tesseroid branch Sep 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment