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

go-fsck: collect package size info #3

Open
titpetric opened this issue Oct 16, 2023 · 0 comments
Open

go-fsck: collect package size info #3

titpetric opened this issue Oct 16, 2023 · 0 comments

Comments

@titpetric
Copy link
Collaborator

Go x/packages allows to collect size info for packages.

https://stackoverflow.com/questions/55132462/how-do-i-check-the-size-of-a-go-project

As a developer, I want to run go-fsck to achieve the following output:

  • the package used
  • number of symbols referenced (int)
  • size of package in KB/MB

Runing go-fsck stats with a --package option should list the packages imported like so:

Import Symbols Size
github.com/evanphx/json-patch/v5 1 20KB

Symbols (1) column counts the number of distinct symbols being used from a package.

Using -v (verbose) should print something along the lines of:

Import Symbol Used
github.com/evanphx/json-patch/v5 DecodePatch (1) 20KB

The number in the brackets is the number of times a symbol is referenced, symbols are ordered descending by the number of uses. Packages may be sorted either by symbols used or by size.

Use case: find out little-used dependencies to remove.

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

No branches or pull requests

1 participant