This repository was archived by the owner on Dec 22, 2021. It is now read-only.
Better Cython for seismic.ttime2d - #62
Merged
Merged
Conversation
Replaced lists for memoryviews of numpy arrays. Replaced lambdas for an inlined cdef function. General speed up of 300x. Yeah. My old code sucked.
Just to follow the new name convention for Cython modules. Doesn't really make sense to have a python alternative to many modules because they wouldn't run in a reasonable amount of time. So modules that have no alternative _*.py module don't need the 'c' in the beginning.
Don't need it because of new speedups. It's not longer a bottleneck as the serial version is 300x faster than the old parallel version.
Included entry on speedup of seismic.ttime2d
It read fatiando_seismic_ttime. Missing the 2d
leouieda
added a commit
that referenced
this pull request
Sep 23, 2013
Better Cython for `seismic.ttime2d`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the Cython code of the straight ray travel-time calculation.
It now uses some memoryviews instead of lists and inlined cdef
functions instead of lambdas. The result: > 300x speed up!
And that is when comparing the old parallel code with a serial run
of the new code.
In short, Cython rocks.