a1f4973090
Based on an observation that strings and arguments are always interleaved, thanks to #15832. Additionally optimize invocations where formatting parameters are unspecified for all arguments, e.g. `"{} {:?} {:x}"`, by emptying the `__STATIC_FMTARGS` array. Next, `Arguments::new` replaces an empty slice with `None` so that passing empty `__STATIC_FMTARGS` generates slightly less machine code when `Arguments::new` is inlined. Furthermore, formatting itself treats these cases separately without making redundant copies of formatting parameters. All in all, this adds a single mov instruction per `write!` in most cases. That's why code size has increased. |
||
---|---|---|
.. | ||
fmt | ||
num | ||
tuple | ||
any.rs | ||
atomic.rs | ||
bool.rs | ||
cell.rs | ||
char.rs | ||
clone.rs | ||
cmp.rs | ||
collections.rs | ||
default.rs | ||
failure.rs | ||
finally.rs | ||
intrinsics.rs | ||
iter.rs | ||
kinds.rs | ||
lib.rs | ||
macros.rs | ||
mem.rs | ||
ops.rs | ||
option.rs | ||
prelude.rs | ||
ptr.rs | ||
raw.rs | ||
result.rs | ||
simd.rs | ||
slice.rs | ||
str.rs | ||
ty.rs |