-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Flutter users should want to generally track their app health including startup latency. To do so, we should have an exact way of reporting the timing of the first frame rendered, which should be roughly when this line runs on the raster thread https://github.com/flutter/engine/blob/99b752ed2c8f87bb1d13d89a7cee3fb9caa3b1f2/shell/common/rasterizer.cc#L532. However, this timing isn't directly accessible by our users.
Instead, users have access to https://github.com/flutter/engine/blob/99b752ed2c8f87bb1d13d89a7cee3fb9caa3b1f2/shell/platform/android/io/flutter/embedding/android/FlutterView.java#L364 and https://github.com/flutter/engine/blob/99b752ed2c8f87bb1d13d89a7cee3fb9caa3b1f2/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm#L504 (ish, I guess we never built the iOS equivalent).
But that includes an additional raster->platform thread indirection. The platform thread being busy to queue would be unrelated to whether we rendered the first frame. We can either have a separate API running on the raster thread to have people run a thread safe closure or we can report back to the platform thread with a timestamp that's already recorded at the source.