-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Increase thread priority before engine init #20922
Conversation
We get huge ANRs in not pure flutter app. We found that 0.15% of the engine initialization took more than 10 seconds, every 10 million starts.
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
@liyuqian cc ? |
change shell->shell_->GetTaskRunners() to task_runners
The change looks reasonable. One challenging question is how to test and verify it. The expected improvement seems to be making 0.15% of engine initialization faster than 10 seconds, as previously observed by 10 million app startups in add-to-app scenarios on mobile devices. It is probably beyond our devicelab's capability to capture that signal reliably on mobile devices. I wonder if we can simulate this in host machines with shell_benchmarks. Currently, it has a |
revert is_valid_ value
OK, I will do measure it by |
We will verify this modification on Toutiao or Douyin in the near future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is a fine low-risk change and beyond the capabilities of our current benchmark harnesses to measure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rerunning the Mac Host Engine
test to see if it's just flaky. Agree that this is low-risk so landing without a test is reasonable. Of course, a test will always be appreciated as it can prevent accidental regressions, or capture similar performance issues caused by threads contention.
Description
We get huge ANRs in not pure flutter app.
We found that 0.15% of the engine initialization took more than 10 seconds, every 10 million starts.
Fellow code show, engine init in ui thread. So Increase thread priority before engine init can reduce time cost
Tests
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.