You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems a flutter build apk --release will compile the hook/build.dart script 3 times. Though a hook/build.dart compiled to build.dill doesn't depend on the build config and therefore shouldn't be in the build-config specific folder.
These are two separate concepts:
Caching of kernels of dart scripts to make hook invocations faster
Running build/link hooks with different build configurations
One could even argue that the native asset builder system should use dart run to invoke hooks (as the hook source code may transitively use assets on it's own) and the dart run tool should be responsible for optimizing repeated runs of the same script with same Dart SDK version.
But if we do it ourselves - we should avoid compiling it several times and putting it in a location that cannot be shared across runs.
The text was updated successfully, but these errors were encountered:
@mosuem Suggested we could compile all hooks together to reduce the number of compilations.
(We could also reduce the amount of jit-compiling while running the hooks by generating a main function that runs all the hooks in topological order and produces all the build configs and build outputs, but that's a larger refactoring.)
One thing that we should take of though if we go that route is that hooks themselves using native assets still works (#1253). This would require 1. Migrating the Dart standalone embedder away from kernel embedding the native assets mapping, and 2. updating the native assets mapping after every hook execution.
Marking low prio as this is performance optimization and not required for v1.
It seems a
flutter build apk --release
will compile thehook/build.dart
script 3 times. Though ahook/build.dart
compiled tobuild.dill
doesn't depend on the build config and therefore shouldn't be in the build-config specific folder.These are two separate concepts:
One could even argue that the native asset builder system should use
dart run
to invoke hooks (as the hook source code may transitively use assets on it's own) and thedart run
tool should be responsible for optimizing repeated runs of the same script with same Dart SDK version.But if we do it ourselves - we should avoid compiling it several times and putting it in a location that cannot be shared across runs.
The text was updated successfully, but these errors were encountered: