Skip to content

Cache common subexpressions in IndexMap - #2802

Draft
blegat wants to merge 1 commit into
masterfrom
bl/map_idx_nl
Draft

blegat wants to merge 1 commit into
masterfrom
bl/map_idx_nl

Conversation

@blegat

@blegat blegat commented Aug 6, 2025

Copy link
Copy Markdown
Member

Extracted from #2788

@odow

odow commented Oct 27, 2026

Copy link
Copy Markdown
Member

I'm going to say no to this one. It seems reasonable that common subexpressions could be supported only in direct_mode without copies.

@blegat

blegat commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Direct mode and non-direct mode shouldn't produce different results like this. For the user, direct_model should be the same as Model except the model transfer should be faster and lighter in memory. So from that perspective, it makes sense that we add this Dict in the IndexMap. We could make it so that when the variables indices map is trivial, we don't do any copy so that most of the time, this dictionary does not get filled.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants