chipweinberger / dart_ui_isolate

A flutter plugin that lets you run `dart:ui` in an isolate.
The Unlicense
14 stars 1 forks source link

Dart UI Isolates performing at 50% compared to Flutter Isolates #4

Open rlueders opened 1 week ago

rlueders commented 1 week ago

I switched to Dart UI Isolate earlier this year. A few days ago I noticed my print statements from the Dart UI Isolates were not showing up in the console. I tried switching back to Flutter Isolates to to see print statements would appear and indeed they did. I also noticed that the performance of the isolates roughly doubled. That is, the Flutter Isolates were performing twice as fast as the Dart UI Isolates. I'm not really sure how this is possible. I would do some more troubleshooting but I'm not really sure were to start since I am merely switching the pub reference from dart_ui_isolate to fluter_isolate.

rlueders commented 1 week ago

Also, the tests in my above comment were running on the latest stable Flutter release (3.24.4) on a physical iPhone 12 Pro Max.

rlueders commented 1 week ago

Digging a little deeper, this appears to have something to do with thread prioritization on IOS. For example, running the CPU profiler from xCode with Flutter Isolate I observe CPU usage of around 800% but with Dart UI Isolate, CPU usage is around 300%. To reiterate, the only thing changing between these two tests is the Isolate package being used. Also, it appears that that this issue only affects IOS as my testing on Android does not indicate any performance disparity between the two packages.

Flutter Isolate:

Screenshot 2024-11-07 at 9 27 01 AM

Dart UI Isolate

Points of interest