]> git.lizzy.rs Git - rust.git/commit
Auto merge of #76017 - JulianKnodt:fmt_fast, r=nagisa
authorbors <bors@rust-lang.org>
Sun, 4 Oct 2020 02:24:20 +0000 (02:24 +0000)
committerbors <bors@rust-lang.org>
Sun, 4 Oct 2020 02:24:20 +0000 (02:24 +0000)
commit4cf3dc19a1e59ffdebe3d8ca106e5b7f2d6d212e
tree8068ed3b1d21fa469768c5b1f57526be140ffac9
parentbad9ad06c00141114900c41750e961574f2ecc15
parent3f1d2aadd19c3cb71f1d88fb0b0c565808a3c040
Auto merge of #76017 - JulianKnodt:fmt_fast, r=nagisa

Use less divisions in display u128/i128

This PR is an absolute mess, and I need to test if it improves the speed of fmt::Display for u128/i128, but I think it's correct.
It hopefully is more efficient by cutting u128 into at most 2 u64s, and also chunks by 1e16 instead of just 1e4.

Also I specialized the implementations for uints to always be non-false because it bothered me that it was checked at all

Do not merge until I benchmark it and also clean up the god awful mess of spaghetti.
Based on prior work in #44583

cc: `@Dylan-DPC`

Due to work on `itoa` and suggestion in original issue:
r? `@dtolnay`