-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Regression in compilation time due to native asset bundling #134427
Comments
My first hunch is that it might be the file access for all dependencies to check if there's a Let me take a look. |
I observe a slowdown locally on One thing I see in the logs is the new
In these 200 milliseconds, it spends 150 ms loading/parsing the (The reason we do work at all with the new feature being disabled, is that we give an error message if any dependency has native assets, but the feature is not enabled.) I'll (1) make a PR to not reparse the package config, and (2) see if I can find anything else which has been slowed down. |
The time spent in the However, this does increase the latency before the I have made #134523 which converts a some of sync file IO and process runs to to the non-sync ones. This changes the log to:
The question now is, should I/O be sync or async in the backend? |
Converting to async I/O sounds like the right choice as long as the Dart code isn't holding onto any instances of |
When the native assets feature is enabled, computing the order in which native assets should be built with
I can tweak the build process slightly, so that if we have cc @jonasfj once this feature is used and we have |
Speeds up the native assets target in the backend by 1. changing other targets `gen_dart_plugin_registrant` and `release_unpack_ios` to do async I/O, 2. not reparsing the package config, and 3. not calling `dart pub deps --json` for 0 or 1 packages (fixed package:native_assets_builder). * #134427 ``` [ +2 ms] native_assets: Starting due to {} [ +2 ms] Skipping target: gen_localizations [ +1 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/package_config_subset} [ +33 ms] gen_dart_plugin_registrant: Complete [ +107 ms] release_unpack_ios: Complete [ +60 ms] Writing native_assets.yaml. [ +7 ms] Writing /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/flutter_build/be2692bbfbc0b9a27fcd2422d52354c6/native_assets.yaml done. [ ] native_assets: Complete ``` -> ``` [ +4 ms] native_assets: Starting due to {} [ ] Skipping target: gen_localizations [ +1 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/package_config_subset} [ +31 ms] Writing native_assets.yaml. [ +8 ms] Writing /Users/dacoharkes/flt/engine/flutter/examples/hello_world/.dart_tool/flutter_build/f9451a65a465bfab70d004e21d6cc1d6/native_assets.yaml done. [ +1 ms] native_assets: Complete ``` ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
SkiaPerf is reporting a 0.5 - 1s regression in debug mode compilation time due to #130494.
https://flutter-flutter-perf.skia.org/e/?begin=1694274733&end=1694422824&keys=Xb9306954671fd63586c21f618c09ccd6&num_commits=50&request_type=1&xbaroffset=36775
I'm a bit concerned because the program being compiled for the benchmark doesn't use the new feature added by the PR (?)
cc @dcharkes @christopherfujino @stuartmorgan
The text was updated successfully, but these errors were encountered: