Can .wasm and .data sizes be further reduced? #184
-
I noticed most of the online demos, including hello world, have a ~2.6MB In contrast this sokol imgui demo has only a 1.1MB Are there any current ways to reduce the binary sizes, or ideas for what code would need changed, or otherwise is this as good as it can be with the design of the bundle? Thanks! This is such an interesting framework to consider for multi-platform development. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi,
I did my tests with https://github.com/pthom/imgui_bundle_template, where I removed the assets folder, and disabled the usage of ImGuiMd, which requires the RobotoFont to be present in the assets folder). i.e, I compiled this file:
and got
|
Beta Was this translation helpful? Give feedback.
Hi,
About the .data file:
The 6MB is due to the fact that all demos share the same resources (with lots of example images and fonts).
It can be reduced to 350Ko if you do not include an assets folder. Those 350Ko will consist mainly of the default font (DroidSans) that is used by hello imgui. The Sokol demo does not include a font (but uses the inline imgui font, which can lead to pixelated results, as you can see on the sokol demo).
About the 2.6MB file: imgui bundle includes a lot more that the sokol demo you linked (OpenCV, freetype, imgui, node editor, implot, immvision, etc, etc). It also links with SDL (which is responsible for a good 1MB, I guess). This can be reduced to 2.2M i…