Skip to content

Commit efd9855

Browse files
committed
Add zng-template notes.
1 parent f57a726 commit efd9855

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/optimize-release.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ Note that you may need some external dependencies to build the `"view"` feature.
4343
To quickly find what features your app is actually using you can temporary set `default = ["release"]` and `cargo run`, the rustc error messages
4444
usually show missing features.
4545

46-
[`zng-template`]: https://github.com/zng-ui/zng-template
47-
4846
## LTO and Codegen Units
4947

5048
The compiler has some parallelism by default to speedup compilation, you can configure the release profile to compile as a single unit
@@ -75,6 +73,8 @@ release = [
7573
opt-level = "z" # instruct the compiler to optimize for size
7674
```
7775

76+
Note that the [`zng-template`] already setups something like this, you just need to fill in the release features on each crate and call `cargo do build-r -z`.
77+
7878
### Nightly
7979

8080
If your project safety constraints allows the nightly compiler and an unstable feature you can enable `-Zshare-generics` to reduce size even more:
@@ -94,4 +94,8 @@ In the command line example above the `RUSTFLAGS` is set to enable the `share-ge
9494

9595
The example also sets the `-C link-args=-znostart-stop-gc`, this is to workaround a nightly only linker issue that affects a dependency of `zng`. Note
9696
that every nightly release can cause all kinds of issues and the `zng` project is only officially supported on the latest stable Rust release. This
97-
optimization was tested on the `2025-01-08` nightly release.
97+
optimization was tested on the `2025-01-08` nightly release.
98+
99+
The [`zng-template`] already setups something like this, call `cargo do build -r -z --bleed` to compile with nightly optimizations.
100+
101+
[`zng-template`]: https://github.com/zng-ui/zng-template

0 commit comments

Comments
 (0)