Open
Description
#125011 has added a optimize_for_size
feature to the standard library, which is designed for special casing some algorithms in core
/alloc
/std
to provide an implementation that tries to minimize its effect on binary size.
To use this feature, the standard library has to be compiled using -Zbuild-std
:
$ cargo +nightly build -Z build-std -Z build-std-features="optimize_for_size" ...
Optimizations that leverage this flag:
- Size optimize int formatting #125606
- Always use the general case char count with
optimize_for_size
#125609 - make
ptr::rotate
smaller when usingoptimize_for_size
#125720 - Skip fast path for dec2flt when optimize_for_size #126271
- Add
optimize_for_size
variants for stable and unstable sort as well as select_nth_unstable #129587