Skip to content

Shell::OnPlatformViewCreated should not serialize on the UI thread #91711

@dnfield

Description

@dnfield

This is a snip from a trace during Shell::OnCreatePlatformView. The highlighted section is where the call is running on the platform thread, and the picture is showing what's going on on the UI thread:

image

We should not be blocking progress on the platform thread while the UI thread is doing this work, and although the comment here says that this is important for some platforms, I'm not convinced that is true.

@chinmaygarde pointed out that the ordering is important in the OnPlatformViewDestroyed route, which I agree with and am less concerned about anyway. A couple concerns that he raised:

  • Will this interrupt ordering of OnPlatformViewDestroyed? No, because a platform task cannot get scheduled before we've enqueued the raster/UI work, and the raster/UI work it enqueues will be blocked by the tasks we've enqueued.
  • Will the logic to check whether the raster/platform thread have been merged still be valid? Yes, because the UI thread will not get a chance to create a platform view, which would require time on the platform runner, before we use that variable.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: money (g3)engineflutter/engine related. See also e: labels.perf: startupPerformance issues related to app startup time

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions