-
Notifications
You must be signed in to change notification settings - Fork 17
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
Reduce binary size #147
Comments
It's 17-21mb after removing cgo, compilation speed and binary size are very impressive, but I'm not very familiar with cpp classes and templates. I will continue to remove cgo when I have enough experience, I tried to manually fix the c abi file generated by miqt and compiled it to dynamic dll, it was 17mb, the outer code of the go project was about 2-3mb, it added up to about 20mb, on par with flutter. However, the main repository needs to carry a lot of c abi dynamic libraries resulting in a larger repository, this is another success story https://github.com/richardwilkes/unison/tree/main/internal%2Fskia |
FWIW in the nim bindings, Another idea might be to follow the upstream modules more closely - ie miqt lumps together QtCore/widgets/etc which might not be necessary for all applications - recycling the upstream qt module organisation has other benefits too since the bindings will be more in tune with available documentation etc. |
I recall trying There is probably only limited use cases for using a language binding of Qt Core without gui/widgets. Almost everything in Core has some sort of native equivalent in Go anyway. I can maybe imagine extending Miqt to bind some custom library that uses Core types without gui/widgets, but that's hypothetical at this stage. (I'm not sure if Qml or Quick depend on Gui.) There are also some difficult circular dependencies in the Qt headers between package types - at least QtMultimedia and QtMultimediaWidgets, etc. |
|
The ideas from #8 and #9 can also help to reduce binary size.
Ideas:
-ffunction-sections -fdata-sections
in CFLAGS, and-Wl,--gc-sections
in LDFLAGS to allow stronger dead code elimination across language boundariesThis causes each function to have segment alignment. If a large proportion of the Miqt C ABI functions are used, all the extra padding in the binary could create a net negative effect.Only section alignment, not segment alignment.qtminimal
The text was updated successfully, but these errors were encountered: