You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reduce binary bloat by removing generic param from type_check
The binary sizes are increased a lot by the use of generics. In one
case, there is a lot of needless bloat by using a generic type param
for the callback argument in the type_check function of the Property
trait.
cargo build --example parse --release && du -sb target/release/examples/parse
Results in a binary size of 1784152 bytes.
With this commit, the binary size is decreased by 12288 bytes, which
is significant for embedded/no_std use.
The sizes above were achieved by adding this to Cargo.toml:
```
[profile.release]
strip = true
panic = "abort"
opt-level = 's'
codegen-units = 1
lto = true
```
Though the difference is roughly the same also without the
optimizations.
As an additional benefit, code clarity is improved as the child arg
was unused in some of the trait implementations.
0 commit comments