reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Responsiveness of controls are slow

Open zdrummond opened this issue 1 year ago β€’ 2 comments

Describe the bug Looking at a couple examples on the product page, there is a number of examples of slow front-end controls.

The canonical example in the Intro has a counter. It has a noticeable lag, looks like ~300ms[1], but feels like near a second.

Looking at the React wrapping demo, there is a noticeable latency when dragging the color circle around, but when I use the demo site for the original component, it has near-zero lag

To Reproduce Uses the above and you should feel lag

Expected behavior That all the Pyncone examples are fast with no extra effort. The simple example of a counter should show no lag, and the wrapped React counter should perform at the same as the component it is wrapping.

Screenshots [1] pynecone_counter_perf

** Specifics (please complete the following information):**

  • Browser: Chrome Version 110.0.5481.177 (Official Build) (x86_64)

zdrummond avatar Mar 13 '23 17:03 zdrummond

Got it thanks for digging into this. I'll look into this more but I think this has to do with larger apps. We are working on ways to prevent other components that don't update from re-rendering and you should see performance improvements on the main website as a result.

Alek99 avatar Mar 13 '23 17:03 Alek99

Quick follow up. On the counter, I did not realize it was hitting the server to update the value. Assuming your UI does not need long-term state and instead wants to store up changes locally (e.g. building a dynamic form to submit), can you bind props to a local state store instead of server hosted state?

zdrummond avatar Mar 14 '23 15:03 zdrummond

I am facing the same issue with the responsiveness. Please check the video attached for the tutorial in docs page:

https://user-images.githubusercontent.com/119093969/229191379-1731a48f-52f5-4ff5-a9b0-90579ec9cff7.mov

arihantnu10 avatar Mar 31 '23 17:03 arihantnu10

When running the same tutorial locally, it doesn't even respond.

arihantparsoya avatar Mar 31 '23 17:03 arihantparsoya

When running the same tutorial locally, it doesn't even respond.

Are you running in dev mode or prod mode?

Alek99 avatar Apr 04 '23 00:04 Alek99

This might be addressed by #2198, which will optimize state updates in larger apps.

masenf avatar Nov 27 '23 20:11 masenf

closing this issue for now

ElijahAhianyo avatar Mar 26 '24 13:03 ElijahAhianyo