Sending large data between Dart and Rust #2280
Replies: 1 comment 7 replies
-
Image processing is exactly why I created frb - I have some image processing in rust for my flutter app! So, firstly, large amount of data from Rust to Dart is zero-copy, as long as it is
Looks like Rust can decode heic: https://crates.io/crates/libheif-rs (which looks like a very thin wrapper around For other formats, there seems to be https://github.com/image-rs/image. I personally find https://github.com/twistedfall/opencv-rust also helpful, but if all you need is just decoding an image then it is an overkill. As for speed, IIRC I do not see any issues. But I do not know how large your "large" is. So I would suggest you to make a simple benchmark and see whether it is fast enough for you. If you find it too slow, don't hesitate to report and we can discuss! |
Beta Was this translation helpful? Give feedback.
-
I was wondering how well this package works with sending large amount of bytes between Dart and Rust.
To give more context, my use case would be to decode images in Flutter and then send the decoded bytes to Rust for more efficient image processing, and then sending the processed bytes back. I understand that it would be more efficient to just decode the image in Rust, but unfortunately I couldn't find a crate that supports all image formats I need (especially heic).
If anyone done something like this, sending large data back and forth, please let me know! I'm curious if it would work and how fast it would be. Or if anyone knows how to decode heic in Rust that information is also very welcome :)
Beta Was this translation helpful? Give feedback.
All reactions