Skip to content

Issues/31511#31582

Merged
chunhtai merged 1 commit intoflutter:masterfrom
chunhtai:issues/31511
Apr 26, 2019
Merged

Issues/31511#31582
chunhtai merged 1 commit intoflutter:masterfrom
chunhtai:issues/31511

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Apr 24, 2019

Description

This pr changed the asset build behavior, it will first gather all the assets, check if any assets has new modify time. if there is, it will rebuild it. otherwise, skip.

Related Issues

#31511

Tests

TBD

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.

Copy link
Contributor Author

@chunhtai chunhtai Apr 24, 2019

Choose a reason for hiding this comment

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

In theory, the expensive part should be

 await writeBundle(fs.directory(fs.path.join('build', 'unit_test_assets')),
          assetBundle.entries);

I check the code assetBundle.build() is just bunch of string operation, it only loads the pubspec files which we cannot avoid anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lets double check the performance of a single test on gallery, since that has a reasonable number of assets.

The benchmark runs on the hello_world test, so we should gather numbers for that too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would you suggest just time several run with and without the patch?

Copy link
Contributor

Choose a reason for hiding this comment

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

sounds like a good approach

Copy link
Contributor Author

@chunhtai chunhtai Apr 25, 2019

Choose a reason for hiding this comment

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

I am seeing a little bit improvement
gallery smoke test 113.4 -> 107
hello world 2.98 -> 2.86

edit I ran ~8 times each case

Copy link
Contributor

Choose a reason for hiding this comment

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

What are the numbers before the original patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if this is intended, the isModifiedAfter will return true if we have not access access the file stat before. no matter what lastModified is.

Copy link
Contributor

Choose a reason for hiding this comment

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

This intended for the other usage of devfs, but is unfortunate in this case. I would add a comment documenting this behavior here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Contributor

Choose a reason for hiding this comment

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

use Iterable.whereType< DevFSFileContent >()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

I would early return to reduce nesting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@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, lets see how the benchmarks do on the devicelab after this is submitted

@chunhtai chunhtai merged commit d121df9 into flutter:master Apr 26, 2019
@chunhtai chunhtai deleted the issues/31511 branch April 29, 2019 20:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants