Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Issue 2877193003: Start actually adding incrementality into incremental kernel generator. (Closed)

Created:
3 years, 7 months ago by scheglov
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Start actually adding incrementality into incremental kernel generator. We now store and reuse resolved kernel libraries. Existing tests are not yet check this, I will add this in future CLs. Also returned ProgramDelta(s) are still not deltas, but full bundles. R=ahe@google.com, paulberry@google.com, sigmund@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/396d72be4c79e9b8edbbdc6e9feb3c4ef6e30f80

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fixes for review comments. #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -79 lines) Patch
M pkg/front_end/lib/compiler_options.dart View 2 chunks +10 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/base/processed_options.dart View 2 chunks +12 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/incremental/file_state.dart View 1 10 chunks +79 lines, -19 lines 2 comments Download
M pkg/front_end/lib/src/incremental_kernel_generator_impl.dart View 1 4 chunks +166 lines, -54 lines 18 comments Download
M pkg/front_end/test/incremental_kernel_generator_test.dart View 3 chunks +74 lines, -0 lines 0 comments Download
M pkg/front_end/test/src/incremental/file_state_test.dart View 2 chunks +4 lines, -4 lines 0 comments Download
M pkg/front_end/test/subpackage_relationships_test.dart View 1 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
scheglov
3 years, 7 months ago (2017-05-12 22:15:37 UTC) #1
Paul Berry
Assuming issues below are addressed, lgtm. https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart File pkg/front_end/lib/src/incremental/file_state.dart (right): https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart#newcode178 pkg/front_end/lib/src/incremental/file_state.dart:178: /// imported into ...
3 years, 7 months ago (2017-05-12 22:24:57 UTC) #2
scheglov
https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart File pkg/front_end/lib/src/incremental/file_state.dart (right): https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart#newcode178 pkg/front_end/lib/src/incremental/file_state.dart:178: /// imported into `dart:core`. On 2017/05/12 22:24:57, Paul Berry ...
3 years, 7 months ago (2017-05-13 02:32:59 UTC) #3
Paul Berry
lgtm https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart File pkg/front_end/lib/src/incremental/file_state.dart (right): https://codereview.chromium.org/2877193003/diff/1/pkg/front_end/lib/src/incremental/file_state.dart#newcode178 pkg/front_end/lib/src/incremental/file_state.dart:178: /// imported into `dart:core`. On 2017/05/13 02:32:58, scheglov ...
3 years, 7 months ago (2017-05-13 02:56:50 UTC) #4
scheglov
Committed patchset #2 (id:20001) manually as 396d72be4c79e9b8edbbdc6e9feb3c4ef6e30f80 (presubmit successful).
3 years, 7 months ago (2017-05-13 02:58:49 UTC) #6
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/incremental/file_state.dart File pkg/front_end/lib/src/incremental/file_state.dart (right): https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/incremental/file_state.dart#newcode49 pkg/front_end/lib/src/incremental/file_state.dart:49: /** nit: let's only use "///" for dartdocs ...
3 years, 7 months ago (2017-05-16 21:37:01 UTC) #7
scheglov
3 years, 7 months ago (2017-05-16 22:03:39 UTC) #8
Message was sent while issue was closed.
I will send a new CL with fixes.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
File pkg/front_end/lib/src/incremental/file_state.dart (right):

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental/file_state.dart:49: /**
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> nit: let's only use "///" for dartdocs

Fixed.
I try to follow this style.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
File pkg/front_end/lib/src/incremental_kernel_generator_impl.dart (right):

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:130: //
TODO(scheglov) add salt
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> might be worth expanding what this means :) - I have no idea what you mean by
> salt here.

Yeah, it's more a reminder for myself. Paul and I are familiar with
AnalysisDriver internals.

Salt something we mix into the signatures and it is a combination of the
compiler version, compilation options, etc.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:137: for (FileState
file in transitiveFiles) {
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> nit: `var` (here it does seem clear from context)

Done.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:146: String
kernelKey = '$signature.kernel';
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> ditto (`var`)

Done.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:149: Set<Uri>
libraryUris = new Set<Uri>();
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> here too

Done.

We probably should write a tool to remove all types for all local variables
then.
I see a lot of well typed code in Fasta.
It would be nice to have similar code style in all places of the package.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:168: await
dillTarget.writeOutline(null);
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> We might need to do something to make `writeOutline` a noop for libraries that
> have already been filled before. In particular, we will call writeOutline once
> per cycle that we are compiling, so if you have:
> 
>    A   -- imports -->   B   -- imports -->   C
> 
> you might be filling the outline of C twice by the time you compile A. This
> might be an issue (the builders might have the contents of C twice), or if
> that's ignored, it appears to be wasteful. So it's probably worth taking a
> closer look.

It works fine, we fill only once.

Loader.buildOutlines() removes from unparsedLibraries.
We fill outlines only for new libraries for which read() was invoked.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:205: for (Uri
fileUri in _invalidatedFiles) {
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> here too (`var`)

Done.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:206: FileState file
= await _fsState.getFile(fileUri);
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> and here.

Done.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:207: await
file.refresh();
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> do you need the refresh to happen one file at a time or is parallelism allowed
> here?
> 
> If parallelism is OK, you could run each of these iterations separately and
> merge them with Future.wait, or you could even do them in 2 stages:
> 
>    List<FileState> files = await
> Future.wait(_invalidatedFiles.map(_fsState.getFile).toList());
>    await Future.wait(files.map((f) => f.refresh()).toList());

I think it will work.
But I'd like to see how it works on real app to measure performance difference.

https://codereview.chromium.org/2877193003/diff/20001/pkg/front_end/lib/src/i...
pkg/front_end/lib/src/incremental_kernel_generator_impl.dart:235: /// included,
they were returned as results for preceding cycles.
On 2017/05/16 21:37:01, Siggi Cherem (dart-lang) wrote:
> minor dartdoc suggestion: consider rephrasing this a bit to clarify that the
> *body* of dependencies is not included, but references to those dependencies
are
> included. 

Done.

Powered by Google App Engine
This is Rietveld 408576698