emilk / eframe_template

The easy way to make a Rust app with a GUI
Apache License 2.0
785 stars 176 forks source link

Room for improvement in the release profile? #163

Closed CramBL closed 2 weeks ago

CramBL commented 3 weeks ago

https://github.com/emilk/eframe_template/blob/ac47eafb17cef09c4b3cb0ba4f523b68367bdd57/Cargo.toml#L41

I might be missing something but why not prefer a profile such as the following?

[profile.release]
opt-level = 3
debug = false
panic = "unwind"
lto = true
codegen-units = 1
strip = true

Users have to download a slightly larger wasm ONCE while better performance is continuously valuable, or what am I missing here?

emilk commented 2 weeks ago

You suggestion leads to slower compile times, larger wasm, and lack of debug symbols. That may be a good trade-off for some people, for others not, which is probably why those aren't the defaults set by cargo/rustc.

In the end, this is only a template - users can change it as they see fit.

CramBL commented 2 weeks ago

Sorry if I came across as rude, I don't know much about WASM so I was mostly looking to test my assumptions before potentially ruining the build configuration in my project.

For what it's worth the proposed build configuration reduces wasm size for this project (and my own) for the template it goes from 2848213 to 2795274 with trunk build --release. It might simply be because of the stripped debug symbols but it doesn't bloat wasm.

Anyways, thanks for the reply and thank you for this awesome project, have a nice day! :star: