Skip to content

Dart running slow on a Raspberry Pi #45715

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

Open
filiph opened this issue Apr 15, 2021 · 1 comment
Open

Dart running slow on a Raspberry Pi #45715

filiph opened this issue Apr 15, 2021 · 1 comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@filiph
Copy link
Contributor

filiph commented Apr 15, 2021

I realize this will sound silly. Of course a Raspberry Pi will run Dart slower than, say, a MacBook Pro. I'm about 90% sure the difference is entirely reasonable given the limitations of the device.

That said, here are a few things to note, just in case there is something going on here after all:

  • Subjectively & anecdotally, the speed difference for Python on a Mac vs Raspberry Pi is smaller than the difference for Dart between those two devices
  • I'm talking about the beefiest Raspberry Pi on the market at the moment, which is model 4B with a Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz and 8GB LPDDR4-3200 SDRAM.
  • I'm comparing to an M1 MacBook Pro, which is also an ARM SoC (though obviously beefier), with 16GB RAM. That device already runs Dart significantly slower than an Intel-based machine, because it runs via Rosetta 2 (see Dart SDK support for macOS arm64 (Apple Silicon) #42773).
  • I'm talking about single-thread performance.
  • The tests below are not hitting thermal throttling (RPi reports temperature at about 60 C).

Here are some random, completely unscientific numbers:

M1 MacBook Pro Raspberry Pi 4 Difference
Precompiling test executable 7.9s 72.0s 9.1x
dart run test in egb 00:15 01:54 7.6x
html_unescape microbenchmark (JIT) 24.6~25.2ms 113.6~119.9ms 4.6x
dart compile exe of benchmark above 2.92s 19.514s 6.7x
html_unescape microbenchmark.exe (AOT) 31.4~38.9ms 287.7~318.5 9.2x

Once again, not sure if these numbers differ from reasonable expectations at all.

Possibly related: #34172.

Dart SDK Version (dart --version)

  • Raspberry Pi: Dart SDK version: 2.13.0-211.0.dev (dev) (Tue Apr 6 18:41:48 2021 -0700) on "linux_arm"
  • Mac: Dart SDK version: 2.12.2 (stable) (Wed Mar 17 10:30:20 2021 +0100) on "macos_x64"
@mraleph
Copy link
Member

mraleph commented Apr 15, 2021

One thing to be aware of is that we don't ship a properly trained frontend server snapshot with ARM SDKs.

You can try to build one locally and see if some of the numbers improve (anything that requires parsing Dart code should become faster):

https://gist.github.com/mraleph/b6e767f00a9d01464de5ab494cf591c4

@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

3 participants