Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fzyzcjy opened this issue Oct 1, 2021 · 5 comments
Closed

Comments

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Oct 1, 2021

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

@shekohex
Copy link
Owner

shekohex commented Oct 1, 2021

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.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 1, 2021

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.

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 7, 2021

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!

@fzyzcjy fzyzcjy closed this as completed Oct 7, 2021
@shekohex
Copy link
Owner

shekohex commented Oct 7, 2021

That's good to know, Thanks!

@fzyzcjy
Copy link
Contributor Author

fzyzcjy commented Oct 7, 2021

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants