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

Recombination performance with very many "regions" #1082

Closed
molpopgen opened this issue Mar 3, 2023 · 0 comments
Closed

Recombination performance with very many "regions" #1082

molpopgen opened this issue Mar 3, 2023 · 0 comments

Comments

@molpopgen
Copy link
Owner

When the number of elements in a genetic map gets very large,
we take a larger performance hit.
For example, the same uniform genetic map with one region vs,
say, 2.5e5 regions, results in orders of magnitude different
performance.

The reason for this is actually simple: the latter queries
each segment, bogging the simulation down by calling the Rng
machinery. (See the implementaion operator() for GeneralizedGeneticMap.)

To reproduce, we can modify cpp_neutral_benchmark/cpp_neutral_benchmark.cc
to subdived the map into a specific number of chunks.
If that number is large, we can reproduce the performance hit.

molpopgen added a commit that referenced this issue Mar 7, 2023
* Use O(1) lookup for regions contributing
  breakpoints via a Poisson process
* Handle the rest via a for loop

Fixes #1082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant