-
Notifications
You must be signed in to change notification settings - Fork 4
Iced Web File Sizes #10
Comments
for reference, facebook.com is 324KB |
Is the 4MB the size of the debug or the release build of your application? |
i followed the instructions on the web README..
and got these files..
maybe the 4.3M is the debug one you refer to, and the 1.1K is the "real" one? built these on my MacOS laptop, if the platform was something to do with it as well. |
Yes, that is the debug build. The debug build contains everything you need to debug the binary and therefore is not optimized by the compiler. The release build will always be smaller than the debug build as it is an optimized binary. To run the release build just add Edit: and of course change the path to the release build at binding 😉
No, the |
okay great. using release i got..
and post processing with what percentage of this size is the overhead of the library itself? wondering if this size will scale linearly with the size of the application. |
I'm not sure about the exact overhead, but maybe you can compile the |
You can also use a tool like cargo bloat to see which crates use the most space, and you can perhaps disable some crate features you're not using. I'm not 100% sure if all these techniques carry over, but you can also look into the techniques described in min-sized rust. |
Just because I recently went through this, I thought I'd share what I did. If you're using trunk like I am, you can just add the following to your index.html as per this page to run wasm-opt as part of the build process:
And add the following to your Cargo.toml file as per min-sized-rust
Then you just have to run trunk to build the wasm:
And I configure my server to point at
I wish it was a little better than 1.7MB but it's still quite the improvement! The main improvements come from the adjustments to Cargo.toml, I only gained about 0.3MB from wasm-opt. |
i was exploring the idea of writing a simple one pager website with a dynamic table on it in Iced. but when i compiled the web example I saw the wasm file is over 4MB.
curious what contributes to that size, is it 90+% the Iced library itself? is there any hope of vastly reducing the size of this file in the future?
probably untenable for me to pursue Iced for this web project if the file sizes will always be multi megabyte.
The text was updated successfully, but these errors were encountered: