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

Issue 1892093003: Support deserialized compilation of the empty program. (Closed)

Created:
4 years, 8 months ago by Johnni Winther
Modified:
4 years, 8 months ago
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Support deserialized compilation of the empty program. R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/2ccfcf438ad320e306909baf0f492efd97101c09

Patch Set 1 #

Total comments: 8

Patch Set 2 : Updated cf. comments #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -42 lines) Patch
M pkg/compiler/lib/src/closure.dart View 3 chunks +25 lines, -2 lines 6 comments Download
M pkg/compiler/lib/src/common/backend_api.dart View 2 chunks +4 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/common/codegen.dart View 3 chunks +7 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/common/resolution.dart View 1 1 chunk +11 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 2 chunks +6 lines, -0 lines 3 comments Download
M pkg/compiler/lib/src/elements/elements.dart View 1 4 chunks +25 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/elements/modelx.dart View 1 chunk +9 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/js_backend/backend.dart View 1 3 chunks +29 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/js_backend.dart View 1 2 chunks +8 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/serialization/equivalence.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/serialization/keys.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart View 3 chunks +9 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/serialization/task.dart View 2 chunks +9 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 1 17 chunks +25 lines, -21 lines 0 comments Download
A tests/compiler/dart2js/serialization_compilation_test.dart View 1 chunk +62 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
Johnni Winther
4 years, 8 months ago (2016-04-15 15:12:00 UTC) #2
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/1892093003/diff/1/pkg/compiler/lib/src/common/resolution.dart File pkg/compiler/lib/src/common/resolution.dart (right): https://codereview.chromium.org/1892093003/diff/1/pkg/compiler/lib/src/common/resolution.dart#newcode186 pkg/compiler/lib/src/common/resolution.dart:186: abstract class Frontend { I ponder about the ...
4 years, 8 months ago (2016-04-15 15:42:14 UTC) #3
Johnni Winther
https://codereview.chromium.org/1892093003/diff/1/pkg/compiler/lib/src/common/resolution.dart File pkg/compiler/lib/src/common/resolution.dart (right): https://codereview.chromium.org/1892093003/diff/1/pkg/compiler/lib/src/common/resolution.dart#newcode186 pkg/compiler/lib/src/common/resolution.dart:186: abstract class Frontend { On 2016/04/15 15:42:14, Siggi Cherem ...
4 years, 8 months ago (2016-04-18 08:05:43 UTC) #4
Johnni Winther
Committed patchset #2 (id:20001) manually as 2ccfcf438ad320e306909baf0f492efd97101c09 (presubmit successful).
4 years, 8 months ago (2016-04-18 08:36:44 UTC) #6
sra1
Do you know why this slowed down compilation by 3%? https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/closure.dart File pkg/compiler/lib/src/closure.dart (right): https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/closure.dart#newcode383 ...
4 years, 8 months ago (2016-04-19 03:07:30 UTC) #8
Johnni Winther
https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/closure.dart File pkg/compiler/lib/src/closure.dart (right): https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/closure.dart#newcode383 pkg/compiler/lib/src/closure.dart:383: String toString() { On 2016/04/19 03:07:30, sra1 wrote: > ...
4 years, 8 months ago (2016-04-19 07:22:24 UTC) #9
Johnni Winther
On 2016/04/19 03:07:30, sra1 wrote: > Do you know why this slowed down compilation by ...
4 years, 8 months ago (2016-04-19 07:23:40 UTC) #10
Siggi Cherem (dart-lang)
Thanks Stephen for catching that regression! https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/compiler.dart File pkg/compiler/lib/src/compiler.dart (right): https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/compiler.dart#newcode1853 pkg/compiler/lib/src/compiler.dart:1853: if (compiler.serialization.isDeserialized(element)) { ...
4 years, 8 months ago (2016-04-19 20:58:02 UTC) #11
Johnni Winther
https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/compiler.dart File pkg/compiler/lib/src/compiler.dart (right): https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/compiler.dart#newcode1853 pkg/compiler/lib/src/compiler.dart:1853: if (compiler.serialization.isDeserialized(element)) { On 2016/04/19 20:58:02, Siggi Cherem (dart-lang) ...
4 years, 8 months ago (2016-04-20 10:40:21 UTC) #12
Siggi Cherem (dart-lang)
4 years, 8 months ago (2016-04-20 18:58:40 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/co...
File pkg/compiler/lib/src/compiler.dart (right):

https://codereview.chromium.org/1892093003/diff/20001/pkg/compiler/lib/src/co...
pkg/compiler/lib/src/compiler.dart:1853: if
(compiler.serialization.isDeserialized(element)) {
On 2016/04/20 10:40:21, Johnni Winther wrote:
> On 2016/04/19 20:58:02, Siggi Cherem (dart-lang) wrote:
> > Could this be a possible cause of the regression?  We are doing this check
now
> > on every access to fetch the resolved AST.
> > 
> > I thought about the following during the review, then forgot to bring it up:
I
> > wonder how early we can remove any distinction between deserialized & parsed
> > element models. Today we hide it behind this `resolution` abstraction, but
> > instead of doing it on queries, we might be able to do it a bit earlier. 
> > My hope is that by the time we load a serialized file, we initialize the
> pieces
> > of the compiler to avoid having to reach into the serialization task at all
> > afterwards.
> > 
> > For this specific use case, maybe we can remove the distinctions when we
first
> > construct the class? For example if we implement the resolvedAst getter in
> > modelz and we store the deserialized impact in the _worldImpactCache, could
we
> > use the same codepath here for both parsed & deserialized elements?
> 
> For swarm SerializationTask.isDeserialized is called 73921 times, 27792 of
these
> from here. If find it surprising if that alone can create a 3% compile-time
> increase.

Yeah - I'm not sure, but this and the other changes to resolveAst could have
other effects for the VM, like making hasResolvedAst polymorphic (since now
there is a second implementation in the serialization task) or it can make
inlining of this method harder for the vm.

Just commenting the lines on this method doesn't justify a 3% regression (did
some perf testing that it only accounts for 0.3%), I'll look and see if
precomputing the `body` of a resolved AST is part of that cost.

Powered by Google App Engine
This is Rietveld 408576698