Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce unsafe in encoding::string::merge
3ab36fda9a1788e0 introduced a ~3% regression on some decoding benchmarks. My best guess is that swapping the value temporarily with a new string is not being optimized well. This commit reverts to using String::as_mut_vec, but carefully clears the string on decode failure. It also fixes up the associated regression test, which wasn't properly covering the malformed UTF-8 case. // Before #194 dataset/google_message3_2/decode time: [219.45 ms 219.48 ms 219.51 ms] thrpt: [458.64 MiB/s 458.72 MiB/s 458.78 MiB/s] // #194 dataset/google_message3_2/decode time: [226.08 ms 226.11 ms 226.18 ms] thrpt: [445.12 MiB/s 445.25 MiB/s 445.32 MiB/s] // This commit dataset/google_message3_2/decode time: [219.05 ms 219.76 ms 221.78 ms] thrpt: [453.94 MiB/s 458.12 MiB/s 459.61 MiB/s]
- Loading branch information