Skip to content

Provide an accurate way of reporting the exact first frame rendered time #85139

@xster

Description

@xster

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.

cc @zanderso, @jiahaog

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: googleVarious Google teamsengineflutter/engine related. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speedplatform-androidAndroid applications specificallyplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions