-
Notifications
You must be signed in to change notification settings - Fork 7
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
Improve Collectvariables
again
#144
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Pull Request Test Coverage Report for Build 8078906539Details
💛 - Coveralls |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #144 +/- ##
==========================================
- Coverage 80.28% 80.08% -0.21%
==========================================
Files 21 21
Lines 1841 1968 +127
==========================================
+ Hits 1478 1576 +98
- Misses 363 392 +29 ☔ View full report in Codecov by Sentry. |
@yebai can you give this PR a quick pass through? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Streamline the checks:
number of dimensions
mismatches is moved to a function calledextract_variable_names_and_numdims
. This function go through the whole model definition and collect all the variables and their ndims.simplify_lhs
, which calls a evaluate function calledsimple_arithmetic_eval
.simple_arithmetic_eval
is more restrictive and should only used to evaluate expression in indices and loop bounds.Base.checkbounds
to perform in bound checking for data arraysAlso used
StaticArrays.MVector
for array sizes, instead of collecting all possible LHS and do post-processing. This gives better memory performance. OnLeuk
, the memory use is reduced from ~6MB to ~3MB, mostly should be attributed to this.Combined, the time is reduce by 1-2 ms.