Replies: 1 comment 5 replies
-
It seems we can do e.g.
even if
Maybe firstly try to run in profile/release mode, i.e. ensure both Rust and Dart are compiled in release (instead of debug). This can have many performance differences iirc. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My goal is to use a rust library inside the Flutter UI loop. I want to register callbacks with the library that then will update the UI. The events are themselves triggered by other UI events that call rust functions.
I have two issues with this, the first is technicality as the library only allows me to register synchronous callbacks, which is somewhat a pain as FRB only allows asynchronous callbacks. I worked around this using a StreamSink.
This however leads to the second problem: Very poor performance in the browser. I created a very minimal test app to drag a widget on a canvas and handle the position update through a rust callback.
This is already very choppy. It starts smooth but randomly the callbacks start to pile up and are only handled every few seconds.
Is there an efficient way to do this using FRB? I tried manually spawning tasks to call a callback and other things. The behaviour is always the same.
I really love the developer experience of FRB compared to js-interop (which we use currently and is a big pain). However the same use case runs buttery smooth using js-interop and I'm struggling to find a way to do this using FRB.
Test Code for Reference
Rust
Flutter
Beta Was this translation helpful? Give feedback.
All reactions