This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
This file contains 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
…xperimental#1681) Summary: Pull Request resolved: facebookexperimental#1681 Minor completeness for the API to allow atoms to be initialized to `Promise` types by wrapping them, similar to atom defaults. To properly allow Promises and such as atom values we also need the ability to set atoms to Promises. The point of this diff is to provide completeness and for future work to support async atoms Differential Revision: https://www.internalfb.com/diff/D34975767?entry_point=27 fbshipit-source-id: 7846112e86a9a4af82a4e76da06944ec02c9f54e
Summary: More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Differential Revision: D35492328 fbshipit-source-id: 6ed71c326c78fe369cd6c73831cbf67467340343
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
labels
Apr 8, 2022
This pull request was exported from Phabricator. Differential Revision: D35492328 |
drarmstr
added a commit
to drarmstr/Recoil
that referenced
this pull request
Apr 8, 2022
Summary: Pull Request resolved: facebookexperimental#1720 More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Differential Revision: https://www.internalfb.com/diff/D35492328?entry_point=27 fbshipit-source-id: 777d9e40ed23eb2e7ff276f489783b8f7553ddfb
drarmstr
added a commit
to drarmstr/Recoil
that referenced
this pull request
Apr 12, 2022
Summary: Pull Request resolved: facebookexperimental#1720 More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Differential Revision: https://www.internalfb.com/diff/D35492328?entry_point=27 fbshipit-source-id: 237e8b138d4869558b9aa8a89b795157600e9aae
AlexGuz23
pushed a commit
to AlexGuz23/Recoil
that referenced
this pull request
Nov 3, 2022
Summary: Pull Request resolved: facebookexperimental/Recoil#1720 More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Reviewed By: noritheduck Differential Revision: D35492328 fbshipit-source-id: 89547b97a7f61b03153cf3afe366a6f47ef22e52
snipershooter0701
pushed a commit
to snipershooter0701/Recoil
that referenced
this pull request
Mar 5, 2023
Summary: Pull Request resolved: facebookexperimental/Recoil#1720 More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Reviewed By: noritheduck Differential Revision: D35492328 fbshipit-source-id: 89547b97a7f61b03153cf3afe366a6f47ef22e52
eagle2722
added a commit
to eagle2722/Recoil
that referenced
this pull request
Sep 21, 2024
Summary: Pull Request resolved: facebookexperimental/Recoil#1720 More red lines! While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes `Snapshot` clones more robust by always cloning the `TreeState` to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching. * Performance test of reading 100 selectors 100 times each took 1/3rd the time. * Performance test of reading 100 selectors with 100 dependencies 100 times each took 1/3rd the time. Reviewed By: noritheduck Differential Revision: D35492328 fbshipit-source-id: 89547b97a7f61b03153cf3afe366a6f47ef22e52
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
performance
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.
Summary:
More red lines!
While supporting some users I realized an opportunity to simplify the selector implementation slightly and optimize cache lookups to happen earlier. Previously, selectors would not cache their own value in the store state, only their dependencies. So, repeated lookups of a selector would require looking up in the more expensive selector tree cache. This optimization fixes that. It also makes
Snapshot
clones more robust by always cloning theTreeState
to avoid snapshot selector lookup aching to inadvertently affect the parent store, which may cause atoms to skip initialization now that we are more aggresively caching.Differential Revision: D35492328