johnthagen / johnthagen/min-sized-rust
Add note about monomorphisation
Open
enhancement
- Dominant language
- Rust
- Stars
- 9.8k
- Forks
- 247
- PR merge metrics
- No merged PRs in 30d
Description
Generics with static dispatch can lead to duplicated functions, and if they are big enough, it will make for a large piece of the final binary.
Alternatives are dynamic dispatch with `dyn`, or just removing generic code.
Is seems very important for minimizing binary size.
(If you don't want to change the function API, **and** the function is being generic over something like `AsRef`, you can also create helper function which resolves `path.as_ref()` and calls a non-generic function that receives `&Path` instead.)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.