In these lines of step_simulation() we use rbind to combine the data frame of existing cases with the data frame for new cases. This happens at least once in almost every time step and is potentially a major bottleneck in terms of speed.
Pre-allocating a large data frame, matrix or list would speed things up, however, that would require some adjustments throughout the package as the state_df data frame has rows removed as well as added. This requires a bit more effort and will be a goal for the next major release.
In these lines of
step_simulation()
we userbind
to combine the data frame of existing cases with the data frame for new cases. This happens at least once in almost every time step and is potentially a major bottleneck in terms of speed.Pre-allocating a large data frame, matrix or list would speed things up, however, that would require some adjustments throughout the package as the
state_df
data frame has rows removed as well as added. This requires a bit more effort and will be a goal for the next major release.