For time series simulations where one tracks large numbers of ancient samples, simulations with tree sequences slow down the more ancient samples you take. When profiling examples/wfts, we see that the time is spent in fwdpp::ts::count_mutations due to time spent advancing trees in fwdpp::ts::tree_visitor::operator().
It turns out that we can skip mutation counting entirely if its only purpose is to generate a recycling queue. If we modify the return value of simplify to include either a vector of indexes of "simplified-out" variants, or a std::queue of such indexes, then we can skip count_mutations entirely. This will be an especially useful optimization for simulations of phenotypes.
For time series simulations where one tracks large numbers of ancient samples, simulations with tree sequences slow down the more ancient samples you take. When profiling examples/wfts, we see that the time is spent in
fwdpp::ts::count_mutations
due to time spent advancing trees infwdpp::ts::tree_visitor::operator()
.It turns out that we can skip mutation counting entirely if its only purpose is to generate a recycling queue. If we modify the return value of simplify to include either a vector of indexes of "simplified-out" variants, or a
std::queue
of such indexes, then we can skipcount_mutations
entirely. This will be an especially useful optimization for simulations of phenotypes.