Skip to content

perf: emit non-overridable constants as C static const values - #898

Merged
chrispcampbell merged 2 commits into
mainfrom
chris/896-static-const
Aug 27, 2026
Merged

perf: emit non-overridable constants as C static const values#898
chrispcampbell merged 2 commits into
mainfrom
chris/896-static-const

Conversation

@chrispcampbell

Copy link
Copy Markdown
Contributor

Fixes #896

See issue for details. I left this as an opt-in optimization (enabled via non-public environment variable) since it can have a small effect on model outputs values, but I will probably eventually enable it for En-ROADS since it provides a decent performance improvement.

AI disclosure: I guided Claude Code (Opus 5) to plan and implement the changes, and then I reviewed and refined the changes.

@ToddFincannonEI ToddFincannonEI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took only a cursory look at the code to make sure that the input vars check would work for EPS. I won't be able to try it until I do the next update of SDEverywhere in the EPS builder in a couple of weeks. Based on the tests and the opt-in decision, I think this can go forward. Another nice and simple optimization with significant impact!

@chrispcampbell
chrispcampbell merged commit ae95064 into main Aug 27, 2026
6 checks passed
@chrispcampbell
chrispcampbell deleted the chris/896-static-const branch August 27, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit non-overridable constants as C static const literals to improve performance

2 participants