Using the Observation beta in computationally expensive use cases #2660
raghavbhasin97
started this conversation in
Beta
Replies: 2 comments 1 reply
-
Hi @raghavbhasin97, a few things come to mind:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@mbrandonw |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all, so I have ben playing around with the branch and migrated away a key piece of my app which does some really computationally expensive stuff.
I have a couple 1000 data points and use those to calculate data for a chart. This has to be done on the fly since the parameters for calculation are highly customizable.
I used a ViewState pattern initially and it worked fine. With the observation stuff I simply converted over the things from ViewStore to store and changed the callsites to be
store.view
(where view is the computed view state). I have to structure it this way with view because different components of ViewState reuse some base computations so destructing would only make it more computationally expensive.I have the View wrapped in
WithPerceptionTracking
I am seeing that this setup takes a huge hit on the performance. Specially with having an interactive gesture on the chart that is sending actions to the reducer on user dragging over it. (I do have sorts of a cache in there to prevent the recompilation of the whole thing when user is interacting) But it still seems to take a hit.
Any suggestions on how to get back the original ViewStore performance?
Beta Was this translation helpful? Give feedback.
All reactions