Skip to content
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

Perf test with SkSL warm-up #56638

Merged
merged 4 commits into from
Jun 6, 2020
Merged

Conversation

liyuqian
Copy link
Contributor

@liyuqian liyuqian commented May 8, 2020

This test verifies that SkSL warmup can speedup cubic_bezier_perf's worst frame rasterization time by 2x (from ~90ms to ~45ms).

Fixes #35142

@fluttergithubbot fluttergithubbot added the team Infra upgrades, team productivity, code health, technical debt. See also team: labels. label May 8, 2020
@fluttergithubbot
Copy link
Contributor

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 liyuqian changed the title [wip] Perf test with SkSL warm-up Perf test with SkSL warm-up May 21, 2020
@liyuqian
Copy link
Contributor Author

@jonahwilliams this test is now ready for review! It exercises all the tools that we've built so far and measures a ~2x speedup on the worst frame rasterization time.

I also look forward to the iOS tool so we can achieve similar speedup in our ios32 benchmarks!

'-t', testTarget,
'--use-application-binary', '$testDirectory/build/app/outputs/flutter-apk/app-profile.apk',
// Getting Observatory URI from --vmservice-out-file is flaky as we're
// not sure when the file is written. Hence we
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this missing the rest of the sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and replaced with --vmservice-out-file

_forwardStream(broadcastOut, 'run stdout');
_forwardStream(_runProcess.stderr, 'run stderr');

// Getting Observatory URI from --vmservice-out-file is flaky as we're
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should delete the file before the test starts and then poll for the existence, that avoid scraping stdout which I 100% guarantee is less reliable. See https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/tasks/track_widget_creation_enabled_task.dart#L118

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Done.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach looks good, but you really need to use the vmservice-out-file or this test will not be reliable/will cause problems if we rephrase any of the messages

Separately, I need to expose a vm service method for pulling the sksl. That would remove the need for all stdout scraping. I can clean that up later though

});

await attachReady.future;
process.stdin.write('M');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the vmservice but got flutterGetSkSL: (-32601) Method not found or s0.flutterGetSkSL: (-32601) Method not found... Can you please check my latest commit and see what I did wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the method is only hooked up in debug mode, are you running in profile/release to generate the sksl? or are you sending the request during drive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if its easier I could add logic to write on exit for drive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work: #58743 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm running in profile mode. #58743 would make this PR much more easier, and it would close #54484!

@liyuqian liyuqian added perf: speed Performance issues related to (mostly rendering) speed c: performance Relates to speed or footprint issues (see "perf:" labels) and removed team Infra upgrades, team productivity, code health, technical debt. See also team: labels. work in progress; do not review labels Jun 6, 2020
@liyuqian liyuqian added this to In progress in Shader warm-up via automation Jun 6, 2020
@liyuqian
Copy link
Contributor Author

liyuqian commented Jun 6, 2020

@jonahwilliams, it's now using --write-sksl-on-exit 😄

@jonahwilliams
Copy link
Member

Yay! I'll try and get iOS hooked up with the sksl bundle soon

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot fluttergithubbot merged commit 9dad2d9 into flutter:master Jun 6, 2020
Shader warm-up automation moved this from In progress to Done Jun 6, 2020
@liyuqian liyuqian deleted the sksl_test branch June 8, 2020 20:48
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) perf: speed Performance issues related to (mostly rendering) speed
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

cubic_bezier_perf__timeline_summary worst_frame_rasterizer_time_millis regressed
4 participants