[ VM / CLI ] Run DartDev isolate from snapshot when possible
This change tries to run from dartdev.dart.snapshot and falls back to running from dartdev.dill if incompatible VM flags are provided. Fixes https://github.com/dart-lang/sdk/issues/43969 Performance results: dart test.dart (no CLI isolate): 0.167s dart run test (from snapshot): 0.208s dart run test (from kernel): 0.326s TEST=pkg/dartdev/test/load_from_dill_test.dart Change-Id: I3195886b86676580ef2a0221f0284328964ef061 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178300 Commit-Queue: Ben Konyi <bkonyi@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
9d1a307954
commit
c42c76f590
+19
-1
@@ -12,7 +12,10 @@ dartdev_files = exec_script("../../tools/list_dart_files.py",
|
||||
"list lines")
|
||||
|
||||
group("dartdev") {
|
||||
public_deps = [ ":copy_dartdev_kernel" ]
|
||||
public_deps = [
|
||||
":copy_dartdev_kernel",
|
||||
":copy_dartdev_snapshot",
|
||||
]
|
||||
}
|
||||
|
||||
copy("copy_dartdev_kernel") {
|
||||
@@ -30,3 +33,18 @@ application_snapshot("generate_dartdev_kernel") {
|
||||
inputs = dartdev_files
|
||||
output = "$root_gen_dir/dartdev.dill"
|
||||
}
|
||||
|
||||
copy("copy_dartdev_snapshot") {
|
||||
visibility = [ ":dartdev" ]
|
||||
public_deps = [ ":generate_dartdev_snapshot" ]
|
||||
sources = [ "$root_gen_dir/dartdev.dart.snapshot" ]
|
||||
outputs = [ "$root_out_dir/dartdev.dart.snapshot" ]
|
||||
}
|
||||
|
||||
application_snapshot("generate_dartdev_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
training_args = [ "--help" ]
|
||||
deps = [ "../dds:dds" ]
|
||||
inputs = dartdev_files
|
||||
output = "$root_gen_dir/dartdev.dart.snapshot"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user