Conversation
|
The code seems correct, but there is no unit test for the combine function. So, ideally, a test is written as well to ensure the behavior is indeed the same. |
|
Good point, I will do this after the weekend. |
88ac54f to
586380e
Compare
|
Added unittests, how do they look to you? The tests pass both on the previous implementation and the one the new one. Please review and if merging, please use fast-forward merge. |
Speed up the combine function by approximately 8x, by removing the intersect and deepcopy, and filling an new dictionary instead. Benchmarks on the 25000 runs of the SIR_model: - old combine function: 1195ms (8.8% of runtime) - new combine function: 146ms (1.2% of runtime)
|
Thanks for the review! I can't merge due to the required checks: Fast-forward merge from a fork, for future reference: |
|
Thanks, with your script, it was easy for me to fix. I could not figure out how to give you the right to bypass checks. |
|
Awesome, thanks for merging! When coming close to the 2.4.0 release I will do some benchmarks for overhead and general performance improvements compared to 2.3.0. I believe together with #232 we can reduce the overhead by at least 80%, promising a up to 5x performance improvement for really small models. |
Speed up the
combinefunction by approximately 8x, by removing the intersect and deepcopy, and filling an new dictionary instead.Benchmarks on the 25000 runs of the SIR_model:
Note that this PR is stacked on top of #232. That one should be reviewed and merged first. For this PR only the changes in
util.pyare relevant.