Skip to content

refactor: remove unnecessary reshape(view(...)) in codegen#4508

Merged
AayushSabharwal merged 2 commits into
masterfrom
as/rm-extra-reshape-view
May 6, 2026
Merged

refactor: remove unnecessary reshape(view(...)) in codegen#4508
AayushSabharwal merged 2 commits into
masterfrom
as/rm-extra-reshape-view

Conversation

@AayushSabharwal
Copy link
Copy Markdown
Member

We used to add all of them since this was cheaper than using search_variables! to identify the ones we need. With IRStructure, this is no longer the case. This reduces the size of the generated code, improves Julia compile time for the generated code, and slightly improves ODEProblem construction time for large models.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

We used to add all of them since this was cheaper than using
`search_variables!` to identify the ones we need. With `IRStructure`,
this is no longer the case. This reduces the size of the generated code,
improves Julia compile time for the generated code, and slightly
improves `ODEProblem` construction time for large models.
@AayushSabharwal AayushSabharwal force-pushed the as/rm-extra-reshape-view branch from e2a07c8 to 1ac0700 Compare May 6, 2026 11:48
@AayushSabharwal AayushSabharwal merged commit 7691a29 into master May 6, 2026
100 of 127 checks passed
@AayushSabharwal AayushSabharwal deleted the as/rm-extra-reshape-view branch May 6, 2026 14:17
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.

1 participant