Skip to content

Dart running slow on a Raspberry Pi #45715

Open
@filiph

Description

@filiph

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions