Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Better Cython for seismic.ttime2d #62

Merged
merged 5 commits into from Sep 23, 2013
Merged

Better Cython for seismic.ttime2d #62

merged 5 commits into from Sep 23, 2013

Conversation

leouieda
Copy link
Member

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.

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`
@leouieda leouieda merged commit f5b38dd into master Sep 23, 2013
@leouieda leouieda deleted the traveltime branch September 23, 2013 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant