This CL updates the frontend_server to allow specifying what dill
file to initialize from.
Normally, it tries to initialize from the same dill file as is the
output. This is fine in many cases (e.g. flutter run always says it
should output to build/app.dill): The first time it compiles
everything, subsequent times (across restarts) it only recompiles
what's needed.
When running tests, however, the output is in a temporary directory,
so it doesn't work across restarts. The startup time for tests is
always rather high, because it always has to recompile everything.
This CL updates the frontend_server to allow specifying what dill
file to initialize from. Flutter can thus save the compiled test
file in a centralized location (e.g. build/test.dill) and load from
that across restarts.
Plumbing this into flutter yields the following result, when running
a single test (the one automatically created when creating a new
flutter project):
Before: ~5.5 seconds
Now, first run: ~5.5 second (unchanged)
Now, subsequent runs: ~3.4 seconds
Approximate breakdown:
Startup cost (e.g. if there's no test directory): ~ 800 ms
Starting up the actual frontend server: ~150 ms
Reading source from old dill, loading all relevant files
and invalidating source: ~ 300 ms
Compiling everything (or, rather, nothing as it's all
from the dill at this point): ~ 650 ms
Serializing: ~ 250 ms
Copying files: ~ 50 ms
Running the actual test: ~1100 ms
Total: ~3300 ms
`time flutter test --local-engine=host_debug --preview-dart-2`
says ~3.4 seconds...
To compare, --no-preview-dart-2 takes ~2.2 seconds,
so dart2 still has a (significantly) higher startup cost.
Moves the needle on https://github.com/flutter/flutter/issues/15767.
Change-Id: I36a2d05bc76e0193d369df42eb3b9f08416dd78f
Reviewed-on: https://dart-review.googlesource.com/51820
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
* Extract parseParenthesizedCondition from parseParenthesizedExpression
* Update parsing of control structures to use parseParenthesizedCondition
* Add a new handleParenthesizedCondition event
Change-Id: I9972bfa3fa4060fc6de2e6315902c4c524c76544
Reviewed-on: https://dart-review.googlesource.com/55560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Also this removes the workaround for dart:html that used a RegExp to
attempt to match inline-JS code that might trigger the problem.
Change-Id: I74b447928aaeaca43b3a9241d42526c284dbeffa
Reviewed-on: https://dart-review.googlesource.com/55504
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Only one import is generated for each library.
If there is already an import for a library, new prefix is not asked.
If a prefix was generated once, it is not possible to force another
import with a different prefix.
R=brianwilkerson@google.com
Change-Id: I1676a1953002060b5e7155ce90abf87b3bfe270e
Reviewed-on: https://dart-review.googlesource.com/55326
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reason for revert: Breaking API change blocks Flutter rolls. Reverting
to reconsider, work around, etc..
Revert "[ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used."
This reverts commit 916b9da48d.
Revert "[ VM ] Fixed tests for non-UTF8 paths on Windows / Macos."
This reverts commit 6327fe91c2.
Revert "[ VM ] Fix failing tests on Windows bots after non-UTF-8 paths change."
This reverts commit b51f4b7956.
Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS."
This reverts commit bcb36247d2.
Revert "Revert "[ VM ] Updated non-UTF-8 tests to expect exceptions on OSX/iOS.""
This reverts commit 24450c79a5.
Change-Id: I756f74f4acdde168d0984fe130f05f9252366334
Reviewed-on: https://dart-review.googlesource.com/55441
Reviewed-by: Todd Volkert <tvolkert@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
The implementation built up a list of closures and then immediately
looped over them to apply them. It seems simpler to do the operations
directly in the first place and it's probably faster too.
Change-Id: I4f3ce4cd1cb1bc3169f1b7190d54118ec22b8bda
Reviewed-on: https://dart-review.googlesource.com/55223
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL is the next step in replacing parseType and improving recovery.
It introduces a new parseVariables method for parsing type parameters
(aka type variables) method in addition to improving recovery in the
parseArguments method.
Change-Id: I4049528152a7c731771d7a8145e5f79729165d79
Reviewed-on: https://dart-review.googlesource.com/55301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This avoids a runtime typecheck failure because Future is Future<dynamic>
which isn't a subtype of Future<T> for any T that is not a top type.
Change-Id: I067987e27177f3ed81ec14101c965488f1c35e2e
Reviewed-on: https://dart-review.googlesource.com/55281
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.
Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
We don't support invalidating `dart:` libraries, so there's no reason
to include such libraries in the computeReusedLibraries calculations:
They should aways be reused.
This CL does exactly that.
On 430 flutter tests, it changes the time it takes to execute
`computeReusedLibraries` by -15.7188% +/- 8.83679%
(-193.125 ms +/- 108.571 ms for all 430 tests) (at 95% confidence).
Said another way it reduces the average runtime for
computeReusedLibraries from ~2.8 ms to ~2.4 ms.
Change-Id: I23a68d4910c81be94b8d9d29495e63546bdad23f
Reviewed-on: https://dart-review.googlesource.com/52441
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Before this CL we always translated a package import URI to file URI
to check whether the file URI had been updated.
This CL changes that so it only does that once* per invalidation of the
.packages file.
Running 430 flutter tests in "batch incremental compilation mode" and
timing computeReusedLibraries, this change, at 95% confidence, changes
the time by -61.7793% +/- 7.63375% (-1941.6 ms +/- 239.914 ms) for all
430 files, or on average reduces the time it takes to run
computeReusedLibraries from ~7.3 ms to ~2.8 ms.
The total compilation time varies too much for it make a difference
at 95% confidence on that figure though.
* Once is a loose term here, it's once per successful compilation, i.e.
if we get a compilation error that goes into erroneousComponent it
doesn't count and we have to do it again and again until we get into
a good state.
Change-Id: Id1b4534f515d8c0487362f743112b44ce1372ed0
Reviewed-on: https://dart-review.googlesource.com/52440
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>