-
Notifications
You must be signed in to change notification settings - Fork 51
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
Binary size #252
Comments
@Wieku maybe its because we also use imnodes and imgui_markdown... [cimgui-go (0) ]$ du -hs lib/linux/x64/*
6.8M lib/linux/x64/cimgui.a
4.0K lib/linux/x64/dummy.go
472K lib/linux/x64/libglfw3.a
5.2M lib/linux/x64/libSDL2.a idk when (in "code history") this issue was opened, maybe your code include sdl unnecessarily? |
@gucio321 I will test over the weekend with a new version, but at the time I was building it with My theory is that because it links statically to the ".a" library it's not stripping unused symbols? IIRC inklyblackness' one is building imgui during the package build. |
@gucio321 I've ported the app to v1.0.0. I've done a symbol export via DLL Export Viewer and all imgui symbols are exported: vs inky, which has only select functions exported: So not stripping theory kinda makes sense I think? I see ~600KB reduction in release build, which in reality is a bit bigger considering fresh build has new code and uses go 1.23. Just for funzies I've ran goweight on v1.0.0, and there's some reduction, but still the size seems kinda excessive: |
sound reasonable. |
I'm migrating my code from https://github.com/inkyblackness/imgui-go (more specifically https://github.com/neclepsio/imgui-go I use as replacement) and was taken by surprise that release build (
-s -w
ldflags) of my program with cimgui-go now weights ~7.5MB more:-tags "exclude_cimgui_glfw exclude_cimgui_sdli"
)Debug build increased from 44.8MB to 61.8MB:
All built with go 1.21.0, gcc/g++ 12.2.0-msvcrt-posix-seh via winlibs.
I don't think implot and immarkdown adds so much so something else is happening but cgo/c/c++ ecosystem is a dark magic to me to figure out what.
The text was updated successfully, but these errors were encountered: