-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Receiving data from an isolate locks the main thread for a very long time #31959
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
customer-flutter
Comments
Hixie
added a commit
to Hixie/flutter
that referenced
this issue
Jan 22, 2018
This reduces the jank of bringing up the license screen further. The remaining lost frame or two are caused by Dart itself, see: dart-lang/sdk#31954 dart-lang/sdk#31959 dart-lang/sdk#31960 Fixes flutter#5187
Hixie
added a commit
to flutter/flutter
that referenced
this issue
Jan 25, 2018
This reduces the jank of bringing up the license screen further. The remaining lost frame or two are caused by Dart itself, see: dart-lang/sdk#31954 dart-lang/sdk#31959 dart-lang/sdk#31960 Fixes #5187
anders-sandholm
added
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
labels
Jan 29, 2018
dart-bot
pushed a commit
that referenced
this issue
Jan 30, 2018
…ssages. Bug: #31959 Change-Id: I7235d24e29b72bc9849d726b63f0d4c38633e803 Reviewed-on: https://dart-review.googlesource.com/37423 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 14, 2018
…struction of the Message. Remove unused special case in ApiMessageWriter for lists of int. This is in preparation for ensuring we always free any external data that ends up in an isolate message. Bug: #31959 Change-Id: I999656fc11d2aee9aebe70852be5bb075f234b4d Reviewed-on: https://dart-review.googlesource.com/41020 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 21, 2018
…ssages. Be careful to free external data when reading or writing a message is interrupted, or releasing messaging without reading on shutdown. Bug: #31959 Change-Id: Ia39acb9ca0e27cf9e8b83961741e5949b5930266 Reviewed-on: https://dart-review.googlesource.com/41561 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Zach Anderson <zra@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
DaveShuckerow
pushed a commit
to DaveShuckerow/flutter
that referenced
this issue
May 14, 2018
This reduces the jank of bringing up the license screen further. The remaining lost frame or two are caused by Dart itself, see: dart-lang/sdk#31954 dart-lang/sdk#31959 dart-lang/sdk#31960 Fixes flutter#5187
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
customer-flutter
The following little flutter program creates an isolate, and times how long the main thread locks while receiving a 100MB of zero bytes from an isolate. It does this by having a timer run continuously on the main thread, timing how long since it last ran, and printing any time that it took more than 5ms between invocations ("since last checkin"). If the main thread is never locked, this should never print anything. At the same time, in a Future-mediated loop on the main thread, it sends a single byte to the isolate, and then receives a 100MB ByteData buffer of zeros in response, and prints the total round-trip time.
The isolate merely runs a Future-mediated loop that waits for a message, then sends a 100MB buffer of zero bytes back.
For flutter, what matters is primarily that the total overhead of receiving something from a thread is small (small single-digits of milliseconds at most, ideally microseconds). Total round-trip time is only of academic interest so long as it's not measured in minutes.
Here is some representative output for this script running on a Pixel XL 2. The total overhead for receiving 100MB from another isolate appears to be in the triple-digit* millisecond range, which means that receiving 100MB from another isolate guarantees that the application will miss many frames, animations will stutter noticeably, etc.
Receiving pure byte data should be something we can implement with near-zero overhead on the receiving thread. It can be placed in memory then the memory handed off without the main thread being particularly involved. When receiving data structures (not benchmarked here), I could see this being more complicated. That is also something we will need to make fast, as it will be common for people to want to create Widgets off the main thread then hand them over efficiently.
See also #31960, which is a less serious problem with sending data taking double-digit milliseconds.
The text was updated successfully, but these errors were encountered: