Replies: 1 comment 4 replies
-
Currently it is not supported yet, because Dart does not seem to provide an API to convert a e.g. One alternative may be, try to allocate it in Rust and only use it in Rust, and Dart only gets an opaque object to that. Another alternative is the raw approach (may make it automatic and safe by integrating into frb in the future): Firstly, allocate a Rust EDIT: Btw I see #2205, so maybe try to see whether the release version is already fast enough, s.t. no optimization is needed. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to write performance-critical code that needs to pass large buffers from dart to rust, which should be modified in-place in rust then. The rust algorithm that I want to use modifies the data in-place, so avoiding the copy should really help performance here.
Something like:
Codegen gives me the following for this code:
So I can't create / access the buffer that I want to fill from the dart side, because I cannot access the generated F64's data from dart.
Is there a way to create a Float64List (typed_data for performance) from dart and pass it to rust in a way that it can be directly modified in rust?
Or maybe there is an even better approach?
Beta Was this translation helpful? Give feedback.
All reactions