Reduce reactivity of MR Diffs by employing Object.freeze on the diff lines data structures
Proposal
In the past we've looked at employing Object.freeze
but it didn't yield that big of a result in our tests.
We need to go deeper and adjust the way we're updating the state as well to ensure we're freezing the objects at the right moment and not erroneously update them when they don't need to be updated.
This involves combing the codebase for any state updates that might be touching the unnecessarily reactive objects.
Please see the section "Restricting reactivity using Object.freeze" in https://codeburst.io/5-vue-performance-tips-98e184338439#dad3 for some deeper explanation
Approach
- Identify the part of the state we want to freeze
- Update the setting of the state
- Explore the ramifications and potential moments where we're inadvertently updating that property
- If required, move the frozen state elsewhere and update the code to read from there instead
- ...
Target of this issue:
- Diff Lines
Others will be handled in a separate issue: #333880 (closed)