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

Report is missing elements #38

Closed
kishaningithub opened this issue May 13, 2024 · 10 comments · Fixed by #49
Closed

Report is missing elements #38

kishaningithub opened this issue May 13, 2024 · 10 comments · Fixed by #49
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kishaningithub
Copy link

kishaningithub commented May 13, 2024

I ran this for my tool tf-import-gen. The unstripped binary size is ~6.2 MB and i wanted to look into what was causing it.

What i did

  • Went into the folder where i have checkout my tf-import-gen repo
  • Ran command CGO_ENABLED=0 go build
  • Ran command gsa --web ./tf-import-gen
  • Opened the web report

What i saw

If you see in the below screenshot the "Package Size" is 2.81 MB but the largest bar within that "Vendor packages size" ~591 KB hence i am not sure where the mega bytes are going

Screenshot 1
image

Screenshot 2
image

@Zxilly Zxilly added the help wanted Extra attention is needed label May 13, 2024
@Zxilly
Copy link
Owner

Zxilly commented May 13, 2024

I test it on Linux and seems vendor packages cost 683 kb and standard library packages cost 2.23 mb.

@Zxilly
Copy link
Owner

Zxilly commented May 13, 2024

Maybe the rendered colours are a bit misleading, I would add different colours for different package types

@kishaningithub
Copy link
Author

I thought the unknown sections size on the right hand side (coloured in light red) which is also like 2 MB was the standard lib. Is it not?

@Zxilly
Copy link
Owner

Zxilly commented May 16, 2024

Generally, unknown is meta information in the binary format itself, such as elf's section header and program header. but it's generally not that big, so if you can provide a sample of the binary file, I can do further analysis.

@kishaningithub
Copy link
Author

@Zxilly Putting below all the information i can get including the binary file. Can you kindly re open this issue?

Zipped binary

tf-import-gen.zip

Size Screenshot

image

gsa version

$ gsa --version
gsa
  Version          v1.0.6
  Go Version       go1.22.3
  Platform         darwin/arm64

Screenshot of startup Warning message

level=WARN msg="Warning: disassembler not supported for this architecture"
image

@Zxilly Zxilly reopened this May 17, 2024
@Zxilly
Copy link
Owner

Zxilly commented May 17, 2024

It does look like there are some issues with macos support, but I think I'd have a hard time fixing it, I work on amd64 on Windows/Linux and support for other architectures and systems is basically based on documentation rather than real experience.

image

I test the binary from the https://github.com/kishaningithub/tf-import-gen/releases/download/v0.8.0/tf-import-gen_0.8.0_linux_amd64.tar.gz and results looks better.

As you can see from the figure, the binary size can be reduced by about 6m after stripping the symbol and debug information.

@kishaningithub
Copy link
Author

Will check the Linux version today.. Was curious to see how much size can be reduced without removing the debug and symbol table info

@kishaningithub
Copy link
Author

Also I can definitely help out on testing and improving this tool for Mac os

@kishaningithub
Copy link
Author

After removing the symbol table and debug information the compressed size went from ~3MB to ~1MB :-) screenshot and link below

https://github.com/kishaningithub/tf-import-gen/releases

Screenshot

image

@kishaningithub
Copy link
Author

After the removal of debug information the size reported looks correct in macos x (screenshot below)

image

Closing this issue for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants