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
This computation is inefficient and redundant with work the CFE already did while resolving the program.
We would like this information to be encoded in the IR in a way that is stable and easy to extract. For example, today the representation of the CheckLibraryIsLoaded is separate from the access and it doesn't indicate which access it is protecting. We did so by design to allow kernel transformations to optimize checks away (e.g hoist them and share them).
My preference is to not derive this information from implicit invariants in the IR. Instead, I propose that we encode the information as data on members or metadata stored on the side. The data we need is basically for each method/initializer, which references to other static methods and constructors are deferred and what deferred prefix/import was used to reach it.
The text was updated successfully, but these errors were encountered:
For reference, I measured recently and it appears that on a large app our entire deferred-loading algorithm takes 32s, of which 18s are used in the hacky reversed engineered step described above.
I looked more into what changes we need to do in dart2js, and I've changed my mind on the strategy to get closer to our end goal here.
Our changes would be very similar if we tried to extract the data from the implicit invariant of CheckLIbraryIsLoaded in the IR, than it will be once we introduce the metadata explicitly. Because at this point we will not be investing in kernel transformations to hoist checks, we'll be using an implementation that derives data directly from the IR tree. This will let us get rid of the hack to compute export scopes, which is also way more expensive as mentioned above.
I'll be sending a CL shortly that seems to be working well.
I believe we don't needs this bug open anymore. Pending work includes:
(this is summarizing some of the discussion I had with @peter-ahe-google this week)
The deferred loading splitting algorithm in dart2js requires 2 pieces of information:
We derive the former directly from the AST, but the latter is today computed using some backward reverse engineering: we look at library dependencies, compute the export scopes, and then try to match which direct dependencies would have gone through a deferred import (see https://github.com/dart-lang/sdk/blob/master/pkg/compiler/lib/src/kernel/deferred_load.dart#L23)
This computation is inefficient and redundant with work the CFE already did while resolving the program.
We would like this information to be encoded in the IR in a way that is stable and easy to extract. For example, today the representation of the CheckLibraryIsLoaded is separate from the access and it doesn't indicate which access it is protecting. We did so by design to allow kernel transformations to optimize checks away (e.g hoist them and share them).
My preference is to not derive this information from implicit invariants in the IR. Instead, I propose that we encode the information as data on members or metadata stored on the side. The data we need is basically for each method/initializer, which references to other static methods and constructors are deferred and what deferred prefix/import was used to reach it.
The text was updated successfully, but these errors were encountered: