-
Notifications
You must be signed in to change notification settings - Fork 22
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
Replace dimension array access with simple index #23
Milestone
Comments
Here are some performance numbers relative to other recent optimizations. PerformanceMacBook Pro (2019) | 2.4 GHz 8-core i9, 32 GB RAM, macOS 10.15
iPhone 8 | A11, iOS 13
iPad Air (2013) | A7, iOS 12
Size
Legend
|
This was referenced Jul 10, 2020
chrispcampbell
added a commit
that referenced
this issue
Jul 13, 2020
Merged to |
This was referenced Sep 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SDEverywhere generates arrays of index numbers to help support subdimensions:
These get declared at the top of the generated c file, for example:
When accessing values, these arrays are used as a form of indirection, for example:
In En-ROADS, some subsets are non-contiguous, but in a majority of cases, these dimension index arrays are "trivial", meaning their elements are identical to their index/position. For those cases, we can generate more optimal code that skips the array access; the example above would become:
Avoiding unnecessary array accesses leads to some more modest performance gains.
The text was updated successfully, but these errors were encountered: