-
Notifications
You must be signed in to change notification settings - Fork 19
Up to 7x faster _save_outputs!() #1217
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
Conversation
Excellent work @ll-ara - this is great! Do you need help with the tests or do you plan on working on those? |
Thanks @DillonJ, I'm currently working on getting it to pass the existing unit test cases - I'll let you know if I need help. |
I have fixed my silly copy-paste mistake + changed it back to a Dict and the unit tests are passing now on my machine. What’s the next step? Running the CI? |
Great - CI usually runs automatically... maybe we are out of resources? @datejada do you know why we are not seeing the tests running automatically? |
I'm not sure whether this is the case, but we may be out of budget. Every month there is a certain amount of hours that we can run such tests. Currently we seem to have already used double the resources that we used last month. Though I would imagine we would get a notification of this. But I'm not ruling it out either. |
@DillonJ and @tarskul The CI workflow was not triggered for this pull request because there are no workflow runs associated with the pull request because there is no GitHub Actions workflow configured to run on We may want to modify the workflow to run on Two options here:
I prefer 1 since PR on forks can be merged without any checks. So, we still need to update the CI to avoid this. LEt me know what you think and then we can proceed |
f67c96d
to
8539bce
Compare
8539bce
to
adf34ba
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1217 +/- ##
=======================================
Coverage 87.68% 87.68%
=======================================
Files 147 147
Lines 4532 4532
=======================================
Hits 3974 3974
Misses 558 558 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@ll-ara, I updated our CI to run the tests on the PR. It looks good. Thanks! One more thing, could you share your tests of logs where you get the x7 speed up? |
@datejada sorry not quite sure what you mean? I added time() calls to the code and printed it out. Do you mean what inputs I used? |
Sorry, I didn't explain myself correctly. I would like to know in which case/example you got the 7x faster. Was it in one of the examples we have or in your own case study. If it is the later, it will be nice to know the size of the case study you got the improvement. Thanks! |
The size was small: only around 15 objects in the rolling optimization |
* used mapping to improve _save_outputs performance * fixed line that was too long * reinstated _output_value_by_ind and changed ‘collect’ to ‘Dict’ --------- Co-authored-by: ll-ara <ll-ara@no-reply.com>
* used mapping to improve _save_outputs performance * fixed line that was too long * reinstated _output_value_by_ind and changed ‘collect’ to ‘Dict’ --------- Co-authored-by: ll-ara <ll-ara@no-reply.com>
Changed 'for' loops to 'map' to remove a bottleneck.
The code is very similar but note that I have changed a dictionary to a vector of pairs with collect(). [Edit: not anymore, it's a dictionary again :)]
Checklist before merging