Skip to content
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

more flexible + better benchmarking + Julia 1.x compliant #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

more flexible + better benchmarking + Julia 1.x compliant #59

wants to merge 2 commits into from

Conversation

pdimens
Copy link

@pdimens pdimens commented May 26, 2020

This PR uses the convert_coord() function in pdimens/PopGen.jl to make ten() faster and more flexible. Flexible in the sense that it can tolerate cardinal directions as well, such as "11 32 42S". In the current form, ten uses a deprecated version of replace and will not function for julia 1.x
Before:

julia> @btime ten("-10 26")
  2.135 μs (33 allocations: 1.52 KiB)
-10.433333333333334

After:

julia> @btime ten("-10 26")
  1.571 μs (18 allocations: 928 bytes)
-10.433333333333334

This PR uses the convert_coord() function in pdimens/PopGen.jl to make ten() faster and more flexible. Flexible in the sense that it can tolerate cardinal directions as well, such as "11 32 42S".
Before:
julia> @Btime ten("-10 26")
  2.135 μs (33 allocations: 1.52 KiB)-10.433333333333334

julia> @Btime ten("-10 26")
  1.571 μs (18 allocations: 928 bytes)-10.433333333333334
src/ten.jl Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants