-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize snapshot cloning overhead for callbacks #1533
Conversation
This pull request was exported from Phabricator. Differential Revision: D33490900 |
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: ccc654763404e87ad5534114767f36c2dc752f39
d86c2e1
to
a2673c2
Compare
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 787b7aede8979ec3a8cddff8a4c03a80b0dce6a4
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 89e1acb5f320959d6c821d7766721366772d460a
a2673c2
to
659a5c3
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 8539d17b7b5ac213f40480f4788d2adba6304cdd
659a5c3
to
24a57ef
Compare
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: https://www.internalfb.com/diff/D33490900?entry_point=27 fbshipit-source-id: f86f64c0e801c34b7af0ce89a1b141e0d193cc50
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: https://www.internalfb.com/diff/D33490900?entry_point=27 fbshipit-source-id: 06018af1f383816428f7813f0dc8585e36f280a4
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: https://www.internalfb.com/diff/D33490900?entry_point=27 fbshipit-source-id: 9d05884e9d054e2a0b68501df0f1b43ff2bb741b
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 09a8504615a71ba4be3dd4e36c1f1dfe873621e1
24a57ef
to
a221254
Compare
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 44f0aed51e5d61701e878c3b593acff87655221a
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: e78014c0fed6e404f7debcf8fa58f5f6f94805eb
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: ed72704df156aa796478d560ab20ed456d84a73f
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 0ff9ea37be80de272ca529fdf0da1912fb7636f2
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 5a3bb5d54438ca3c0690d7eddb73dddb504f6845
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: b7326c6cf0d3a90565ddabca1bddd5e313e225b9
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 2c6cc370c672a6e4b016ce31d8b49eedfb1c9ce5
a221254
to
fd14b21
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 592ac8edf75b41ab899821939a0f7231b2262474
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 39737c4ea69724939beb390089a62fdbbedadd4c
fd14b21
to
8269522
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: c1d1faa97dea0c55de7b51f93d605b015e4eaf3e
This pull request was exported from Phabricator. Differential Revision: D33490900 |
8269522
to
a225d2a
Compare
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 9080ec65b945b7fa9f53154b683ab5c055cd3338
a225d2a
to
4f830c3
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Differential Revision: D33490900 fbshipit-source-id: 0c82999b0cbf53ccea8ed61f6c44cb741ed468ce
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 41cad9a396f9b8aaabb309656775ea2f4abefe3c
4f830c3
to
60cfcac
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
Summary: Pull Request resolved: facebookexperimental#1545 With us relying more on accurate snapshot retention I tracked down where we were getting warnings about using released snapshots to the RecoilDevTools `<Connector>` component. * Properly retain the snapshot until it is used in the effect for tracking. While snapshots are retained until an effect releases them, that auto-release effect was running before this tracking effect. * Also cleanup the `useEffect()` to have a proper deps array and support proper cleanup and re-connecting. Remove setting an `initialSnapshot` as it would have caused the effect to re-connect each time. Curiously, re-connecting casuses new state changes to not appear in the dev-tools, so the `<Connector>` may not yet be compatible with `<StrictMode>`. Differential Revision: https://www.internalfb.com/diff/D33559247?entry_point=27 fbshipit-source-id: 5bfed7ffb938a46033445fff09d42b351cfc0daf
…tal#1546) Summary: Pull Request resolved: facebookexperimental#1546 Add an `isRetained()` method for Snapshots and do a safety check in `retain()` to make sure we are not trying to retain snapshots that have already been released. Differential Revision: D33559535 fbshipit-source-id: f4560b46468f7fe9529bcbaa304d99994d9b4ef7
…l#1533) Summary: Pull Request resolved: facebookexperimental#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 8d69e3bf3dc7da94e64adc5d58b604ea8aea0ad2
60cfcac
to
8b3cd1c
Compare
This pull request was exported from Phabricator. Differential Revision: D33490900 |
Summary: Pull Request resolved: facebookexperimental/Recoil#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 093b2aa498337bb2abc8eebe54a72e1a130b3469
Summary: Pull Request resolved: facebookexperimental/Recoil#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 093b2aa498337bb2abc8eebe54a72e1a130b3469
Summary: Pull Request resolved: facebookexperimental/Recoil#1533 If a user has a recoil callback, such as from `useRecoilCallback()`, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed. Reviewed By: habond Differential Revision: D33490900 fbshipit-source-id: 093b2aa498337bb2abc8eebe54a72e1a130b3469
Summary: If a user has a recoil callback, such as from
useRecoilCallback()
, and uses it to get a snapshot many times in a loop it could incur overhead for cloning the snapshot. Optimize this by caching the cloned snapshot and only cloning a new one if the store or state has changed.Differential Revision: D33490900