Skip to content
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

Cache sorted variables to improve compile performance #528

Closed
chrispcampbell opened this issue Aug 28, 2024 · 0 comments · Fixed by #531 or #530
Closed

Cache sorted variables to improve compile performance #528

chrispcampbell opened this issue Aug 28, 2024 · 0 comments · Fixed by #531 or #530

Comments

@chrispcampbell
Copy link
Contributor

I noticed while working on #527 that calling the xxxVars functions (e.g., auxVars) results in some redundant sorting work in the case where sde generate is used with both --list and --outformat (JSON listing in addition to code gen). This is the case for any project using the sde bundle or sde dev commands. The reason that the work is redundant is that these functions are called once during code gen, and then again when generating the JSON listing.

By caching the return value of these functions in a Map, the execution time for sde generate --outformat=c --list for the En-ROADS model goes from 5.2s to 4.9s (on my M1 Max), about a 5% improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant