Shrink Atom and Reaction using a bitfield#3901
Merged
mweststrate merged 1 commit intomobxjs:mainfrom Jul 17, 2024
Merged
Conversation
🦋 Changeset detectedLatest commit: 281179f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1 task
Member
|
Looking great again, thanks a lot! |
Merged
|
My project stopped working after this update. Will check exactly, what's happening |
taj-p
pushed a commit
to taj-p/mobx
that referenced
this pull request
Aug 30, 2024
Collaborator
|
I'll try to make a repro case this weekend and if it succeeds send a PR over to bump the version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following on from #3880, use a bitfield to reduce the size of
AtomandReaction. Large apps can have 10s or 100s of thousands of these. Also further shrinkComputedValueby storingdiffValuein the bitfield, because it's only ever0or1.Memory Savings
ComputedValueAtomObservableValue(inherits fromAtom)ReactionName Changes
Note this PR changes the names of some members of the above classes to get around the problem mentioned here: #3880 (comment). If these are part of a documented, stable public API then we will need to find another solution.
Soaking Time
We discussed here #3880 (comment) that we should let the previous changes to
ComputedValuesoak for a bit to flush out any issues. We have been shipping those changes for a few weeks in production now and haven't seen any problems yet.Code change checklist
/docs. For new functionality, at leastAPI.mdshould be updatedyarn mobx test:performance)