shekohex / allo-isolate

Run Multithreaded Rust along with Dart VM (in isolate) 🌀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How is the library tested? (I cannot run it via Valgrind + real Dart)

fzyzcjy opened this issue · comments

Since this lib interacts with Dart, it is very important to test it with real Dart. Otherwise, you know, memory problems can exist and cause big troubles. I have tried to use Valgrind on a (real) Dart + rust but failed. So how do you guys to it? Thanks

What we currently do is emulating the DartVM in rust, just emulating the behavior that we got by reading the sdk/vm codebase.

But for actual testing on real Dart, it is hard for now, what you can do is running a simple flutter app with no UI and run it on a real device on profile mode.

Then you have an observability URL that you can open in the browser and keep an eye on the memory usage.

In the app code, you can pass messages between Rust and Dart with a big payload (say 512kb or 1M) and start observing the memory usage getting high and low or if it keeps growing indefinitely.

Also, it would be cool to do the same experiment with the new ZeroCopyBuffer to see the difference.

Would be super helpful to publish the result/screenshots of the memory graph here too.

Good idea. I am currently trying to do that using a dart (not flutter) vm. The valgrind outputs are not that good currently, but I will show you the results when I figure it out.

Hi, I have added:

  • Dart + Valgrind test
  • Flutter on iOS, Flutter on Android test

See: the "test" CI workflow in https://github.com/fzyzcjy/flutter_rust_bridge

Seems that allo-isolate does not have memory problems. Yeah!

That's good to know, Thanks!

You are welcome!