Skip to content

Add support for analyzing GopherJS artifact size. #983

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

Closed
wants to merge 1 commit into from

Conversation

nevkontakte
Copy link
Member

When --analyze_size flag is passed to GopherJS, an additional
${packagename}.js.svg file is creates with a TreeMap diagram that
visualizes which packages contributed to the artifact size and how much.

The data is obtained by counting bytes written for each section of the
file including GopherJS's own prelude and works accurately both in
minified and default modes.

Most of diagram-related logic is isolated to the build/analysis package
with minimal changes to the rest of the code base.

Fixes #982.

When --analyze_size flag is passed to GopherJS, an additional
${packagename}.js.svg file is creates with a TreeMap diagram that
visualizes which packages contributed to the artifact size and how much.

The data is obtained by counting bytes written for each section of the
file including GopherJS's own prelude and works accurately both in
minified and default modes.

Most of diagram-related logic is isolated to the build/analysis package
with minimal changes to the rest of the code base.
@nevkontakte
Copy link
Member Author

CircleCI seems as node-gyp stage:

#!/bin/bash -eo pipefail
cd node-syscall && node-gyp rebuild && mkdir -p ~/.node_libraries && cp build/Release/syscall.node ~/.node_libraries/syscall.node
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.0
gyp info using node@10.0.0 | linux | x64
gyp info find Python using Python version 2.7.17 found at "/usr/bin/python"
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: ENOENT: no such file or directory, mkdir '/root/.cache/node-gyp/10.0.0'
gyp ERR! System Linux 4.15.0-1077-aws
gyp ERR! command "/root/.nvm/versions/node/v10.0.0/bin/node" "/root/.nvm/versions/node/v10.0.0/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/go/src/github.com/gopherjs/gopherjs/node-syscall
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok 

As far as I can tell it's unrelated to this PR.

@nevkontakte
Copy link
Member Author

I believe this is the same issue @visualfc attempted to fix in visualfc@38d9e0d

@nevkontakte
Copy link
Member Author

I am going to shelve this PR for the time being. It is a nice feature, adds a significant amount of code to the project, which I can't in a good faith say we have time to maintain. I will revisit this topic once the project is in a better place and has a larger contributor base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output file size analyzer tool
1 participant