-
Notifications
You must be signed in to change notification settings - Fork 20
Improve compile time of Flows #1475
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1475 +/- ##
==========================================
- Coverage 97.31% 97.28% -0.04%
==========================================
Files 187 187
Lines 16027 16017 -10
==========================================
- Hits 15597 15582 -15
- Misses 430 435 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
HenrZu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this great addition :) The head-tail iteration is really smart.
I have a few minor comments.
I just checked, and the maximum recursion depth is around 1000 (depending on the compiler). I know that this is a super artificial setup, but maybe its necessary at some point, we should perhaps leave a comment in the file that you can increase it with a flag. What do you think? (Especially considering the ODE model with fully continuous mobility, where we also have the spatial index).
Co-authored-by: Henrik Zunker <69154294+HenrZu@users.noreply.github.com>
Co-authored-by: Henrik Zunker <69154294+HenrZu@users.noreply.github.com>
Maybe it makes sense to mention in the rst documentation that FlowModels with >500 Flows are a questionable idea. But I don't think putting comments on compiler flags deep into the metaprogramming header will be very helpful. But the kind of errors you get when this fails are usually well searchable. Also, you will notice the compile time increase. I lean towards not writing down anything. Web results are probably easier to find then our text, wherever we put it. Also, the flags vary by compiler (and maybe even version?). |
Co-authored-by: Henrik Zunker <69154294+HenrZu@users.noreply.github.com>
Changes and Information
A fairly small change to the index_of_type implementation results in a significant reduction in time and memory used during compilation of larger flow models. Tested on the off-repo sde_ui10 that uses ~400 flows, resulting in a speedup of 4 while using 1/5 of the memory. This is a rough measurement using
/usr/bin/timeon clean compiling the ui10 example, see the attached file for details.Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)