Skip to content

Performance Improvement for SliverFillRemaining - #44471

Merged
Piinks merged 6 commits into
flutter:masterfrom
Piinks:sfr
Nov 26, 2019
Merged

Piinks merged 6 commits into
flutter:masterfrom
Piinks:sfr

Conversation

@Piinks

@Piinks Piinks commented Nov 8, 2019 •

Copy link
Copy Markdown
Contributor

Description

This PR changes the layout work done by RenderSliverFillRemaining, that sometimes would do a second layout path. Instead, since SliverFillRemaining has box children, it uses intrinsic size information.

Tests

Updated tests and added a few that test the horizontal axis.

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@Piinks Piinks added framework flutter/packages/flutter repository. See also f: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) f: scrolling Viewports, list views, slivers, etc. labels Nov 8, 2019
@Piinks Piinks changed the title Performance Improvement SliverFillRemaining Performance Improvement for SliverFillRemaining Nov 8, 2019
@liyuqian

Copy link
Copy Markdown
Contributor

Thank you @Piinks for improving the performance! It would be nice if you can add some performance test to capture and quantify your improvement. It will also prevent accidental performance regression in the future. See https://docs.google.com/document/d/1UolaKhEWieP2DDOhFuVQOuR5e545mO2obXcHH6p40Y4/edit#bookmark=id.70t9gnas5d1j for more info.

Please let me know if you have any questions about performance testing. I'm happy to answer them, or review the code in general.

@Piinks

Piinks commented Nov 15, 2019

Copy link
Copy Markdown
Contributor Author

I don't know that I have any baseline to measure a performance improvement for this change. This change is not motivated by a reported issue or performance problem. I am not sure how to capture or quantify any improvement then. 🙂

@liyuqian

Copy link
Copy Markdown
Contributor

@Piinks : I see. The easiest way to get a baseline or to quantify the performance change is probably just running our existing tests. Have you noticed any difference in home_scroll_perf__timeline_summary, tiles_scroll_perf__timeline_summary, or home_scroll_perf__timeline_summary test before and after your patch?

(To run the test, cd flutter/flutter/dev/devicelab && ../../bin/cache/dart-sdk/bin/dart bin/run.dart -t <test_name>)

@Piinks

Piinks commented Nov 15, 2019

Copy link
Copy Markdown
Contributor Author

Ah! Thanks! I will check that out and report back! 💯

@Piinks

Piinks commented Nov 15, 2019

Copy link
Copy Markdown
Contributor Author

Looks like a minor improvement for home_scroll_perf__timeline_summary 90th_percentile_frame_rasterizer_time_millis. 🙂 Cool!

@liyuqian

Copy link
Copy Markdown
Contributor

Good to hear @Piinks ! In that case you probably don't need to write a new performance test. Can you please post your local test result to this PR's description for future reference?

@Piinks

Piinks commented Nov 18, 2019

Copy link
Copy Markdown
Contributor Author

Perf test results after latest merge from master. :)

"success": true,
  "data": {
    "average_frame_build_time_millis": 2.928195402298851,
    "90th_percentile_frame_build_time_millis": 6.189,
    "99th_percentile_frame_build_time_millis": 9.166,
    "worst_frame_build_time_millis": 43.872,
    "missed_frame_build_budget_count": 1,
    "average_frame_rasterizer_time_millis": 7.273534482758619,
    "90th_percentile_frame_rasterizer_time_millis": 15.027,
    "99th_percentile_frame_rasterizer_time_millis": 21.857,
    "worst_frame_rasterizer_time_millis": 51.239,
    "missed_frame_rasterizer_budget_count": 14,
    "frame_count": 174,

@Piinks Piinks added the a: quality A truly polished experience label Nov 18, 2019
@liyuqian

Copy link
Copy Markdown
Contributor

@Piinks : are you waiting for some framework expert to review this PR? (Just found this lonely PR again in the performance triage.)

@Piinks

Piinks commented Nov 22, 2019

Copy link
Copy Markdown
Contributor Author

Hey @liyuqian, thank you. Yes this is waiting on a review. Would you like to give it a look? It is a fairly trivial change.

@liyuqian liyuqian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Piinks
Piinks merged commit 8a48a27 into flutter:master Nov 26, 2019
@goderbauer goderbauer mentioned this pull request Nov 26, 2019
8 of 9 tasks
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 3, 2021
@Piinks
Piinks deleted the sfr branch March 14, 2025 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: quality A truly polished experience c: performance Relates to speed or footprint issues (see "perf:" labels) f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants