fix: Stop tracking special expressions that don't refer to any variables after their values have been computed#4193
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughManager replaces dual per-entity flags with a single ChangesEntity recomputation state tracking
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Julusian
left a comment
There was a problem hiding this comment.
It would be great to have a test or two to verify that this works as expected.
Probably requires adding a method to be able to query the internal state of this class a little, but that is an acceptable tradeoff
…bles after their values are computed. (bitfocus#4193)
9ffc83a to
1dda76e
Compare
Turns out no, indexed access can evade TypeScript access restrictions so just needed to make Added miscellaneous tests, didn't want to be too overly tied to the exact timer dispatch so I had to do some manual looping in poor-man's state tracking. Original patch is the same, all adjustments are in the second patch -- and aside from the rename all is in test code. |
1dda76e to
fcbc288
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e3f864cb-5e88-44b8-8660-dd3c2d2b9cd9
📒 Files selected for processing (2)
companion/lib/Controls/Entities/EntitySpecialExpressionManager.tscompanion/test/Controls/Entities/EntitySpecialExpressionManager.test.ts
fcbc288 to
4eb51f0
Compare
This is a followup optimization after #4065.
The value of a special expression only changes if the value of a variable it depends upon changes. A special expression that refers to no variables, can never change. Therefore, there's no need to keep tracking such expression to recompute it as variables change value.
Before this change, it looks like every single feedback was being continually tracked for
isInvertedspecial expressions, for all time, and same now for all actions forstoreResultas of that feature landing. This will minimize the former to exactly those feedbacks containing anisInvertedthat depends upon a variable, and the latter to only those actions that depend upon a variable -- the least tracking possible.Summary by CodeRabbit