-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementImprove featuresImprove features
Description
Currently, when ThorVG.flutter performs animation rendering via FFI, the main UI thread may become blocked in heavy cases, resulting in visible freezing or stuttering of the user interface.

https://dart.dev/language/isolateshttps://dart.dev/language/isolates
It'd be beneficial if we could consider offloading intensive animation calculations to a Dart Isolate. This approach would allow the main thread to remain responsive, ensuring smooth UI updates regardless of the complexity of the animation logic. The Isolate would handle the heavy computation and return results to the main thread for rendering on the canvas.
Considerations
- Data Transfer: Using
SendPort/ReceivePortfor heavy data passing could overhead (ex_ animation frame data)- Solution: Passing
ffi.Pointer<FlutterLottieAnimation>rather than original buffer would not take much
- Solution: Passing
- Using multipel concurrency model: If both Dart Isolate and native threading are combined, issues like race conditions, synchronization challenges, and increased debugging complexity may arise.
- Note: Native threading support #5 should be discussed alongside these considerations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementImprove featuresImprove features
Type
Projects
Status
Todo