commit | ae593598f8a7708a40c37ab57b5f85d61b65224c | [log] [tgz] |
---|---|---|
author | Jens Johansen <jensj@google.com> | Mon Jan 17 09:43:14 2022 +0000 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Jan 17 09:43:14 2022 +0000 |
tree | aaf228d8656321e00d5f97183baf0879f22f3678 | |
parent | 497eda096a1885e869666a94b7f6b2421e8da1c4 [diff] |
[dart:ffi] Only operate on transitive dependencies of dart:ffi This CL does two things: * "Reenable" the skipping of the dart:ffi transformation entirely when the application does not use dart:ffi. This was originally added in ad596359a676 but was logically disabled in 455811210525 when dart:core started depending on it. Here we now ignore (real) dart:* libraries when looking for dependencies of dart:ffi. * Find the subset of the just compiled libraries that transitively depend on dart:ffi and just run the dart:ffi transformation on those libraries. For dart2js that doesn't use dart:ffi at all we go from: ``` $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:09.003428: Transformed ffi natives in 51ms. 0:00:09.203442: Transformed ffi annotations in 199ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:09.098175: Transformed ffi natives in 52ms. 0:00:09.296847: Transformed ffi annotations in 198ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:08.854341: Transformed ffi natives in 57ms. 0:00:09.061804: Transformed ffi annotations in 207ms. ``` to ``` $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:09.138651: Skipped ffi transformation in 1ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:09.242590: Skipped ffi transformation in 1ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v pkg/compiler/bin/dart2js.dart | grep -i "ffi" 0:00:09.163885: Skipped ffi transformation in 1ms. ``` When compiling the flutter gallery app that does depend on dart:ffi we go from: ``` $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:16.344955: Transformed ffi natives in 78ms. 0:00:16.777218: Transformed ffi annotations in 432ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:15.994674: Transformed ffi natives in 80ms. 0:00:16.472779: Transformed ffi annotations in 478ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:16.027488: Transformed ffi natives in 81ms. 0:00:16.491362: Transformed ffi annotations in 463ms. ``` to ``` $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:15.991628: Transformed ffi natives in 30ms. 0:00:16.226564: Transformed ffi annotations in 234ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:16.184984: Transformed ffi natives in 29ms. 0:00:16.404439: Transformed ffi annotations in 219ms. $ out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart -v --target=flutter --platform=/tmp/tmp.6KV5psVGIG/flutter_patched_sdk/platform_strong.dill /tmp/tmp.6KV5psVGIG/gallery/lib/main.dart | grep -i "ffi" 0:00:15.933513: Transformed ffi natives in 27ms. 0:00:16.145640: Transformed ffi annotations in 212ms. ``` TEST=Assuming tests already exists. Change-Id: Ie13be1924d3439cb710c782af81e1e42cda2a838 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228001 Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.