Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart2js: Better encoding of deferred part dependencies #29635

Closed
rakudrama opened this issue May 16, 2017 · 1 comment
Closed

dart2js: Better encoding of deferred part dependencies #29635

rakudrama opened this issue May 16, 2017 · 1 comment
Assignees
Labels
dart2js-optimization type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@rakudrama
Copy link
Member

In a large app with many deferred parts, the metadata for loading the deferred parts is about 1% of the total main part size.

The problem would be reduced by merging parts (#29572) but there is also a problem that the representation has redundancies.

  1. There are two parallel maps (JavaScript objects) from library key to list of parts, one for file names, the other for hashes.
  2. Many parts occur in several lists, duplicating the names and hashes. The average parts per library is ~15 parts. 330 parts are mentioned 1500 times in describing ~100 libraries.

I suggest a level of indirection.

  1. One map from library key to list of part indexes
  2. An array of part file names
  3. An array of part hashes

This would reduce the current ~100kB to ~25kB.

@rakudrama rakudrama added web-dart2js dart2js-optimization type-enhancement A request for a change that isn't a bug labels May 16, 2017
@rakudrama rakudrama self-assigned this Jan 3, 2018
whesse pushed a commit that referenced this issue Jan 5, 2018
'Normalize' the data used for loading deferred libraries.  Replace
URIs and SHA1 hashes with indexes so that the URIs and hashes occur
once.

Bug: #29635
Change-Id: I3ac8791ad44ca588cbb1bd7d86f18243c956a04a
Reviewed-on: https://dart-review.googlesource.com/32505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
@rakudrama
Copy link
Member Author

The suggestion has been implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dart2js-optimization type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

1 participant