Hacker News new | ask | show | jobs
by mraleph 887 days ago
> Dart+Flutter look promising until you notice that they run Skia WASM inside the dart VM which itself runs in WASM which runs inside a JS VM and performance is abysmal.

That's not how Flutter works on either of the platforms it supports.

When you run natively (e.g. mobile, desktop, etc) Skia or Impeller execute natively and all your Dart code is compiled ahead-of-time to native code as well. No JS or Wasm is involved anywhere in the stack. No JIT compilation in release binaries, only during development.

When you run on the Web - then naturally Skia is compiled to Wasm and Dart code is compiled to JS or Wasm, JS VM will end up running both of those. No Dart VM is involved anywhere here.

1 comments

When I profile the (excruciatingly slow) demo website

(EDIT: WARNING that link crashes Firefox on my phone)

https://superdash.flutter.dev/

it sure looks like there are parts of the Dart VM in the call stack. Maybe I should have said Dart runtime?

But anyway, the dart example app stutters on my Android phone and the website stutters on my quad-core laptop with a mobile 3080. And it's basically just tappy chicken, so a simple 2D side scroller.

Not my comment, but relevant here "The problem with compiling Skia to WASM is you'll lose any benefits of hardware graphics acceleration on the device."

(From https://github.com/AvaloniaUI/Avalonia/discussions/6831#disc... )

These examples for the flutter rpg game engine seem to run great on my old pixel 3, under the hamburger menu > mini games:

https://bonfire-engine.github.io/examples/bonfire-v3

That "map by tiled" example feels like 10 fps on my Firefox mobile. It's significantly better than the official Flutter demo game, but significantly worse than a pure JS framework.