about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/erase.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-09 17:58:25 +0000
committerbors <bors@rust-lang.org>2025-04-09 17:58:25 +0000
commit934880f586f6ac1f952c7090e2a943fcd7775e7b (patch)
tree3091aa692f773533762cee3882a837248246f0a3 /compiler/rustc_middle/src/query/erase.rs
parent48f89e7659678f91a68c0c2d868180a0036ab32d (diff)
parentff248de852c46fc0fccd31e466b1f2137381d1d6 (diff)
downloadrust-934880f586f6ac1f952c7090e2a943fcd7775e7b.tar.gz
rust-934880f586f6ac1f952c7090e2a943fcd7775e7b.zip
Auto merge of #124810 - lincot:speed-up-string-push-and-string-insert, r=tgross35
speed up `String::push` and `String::insert`

Addresses the concerns described in #116235.

The performance gain comes mainly from avoiding temporary buffers.

Complex pattern matching in `encode_utf8` (introduced in #67569) has been simplified to a comparison and an exhaustive `match` in the `encode_utf8_raw_unchecked` helper function. It takes a slice of `MaybeUninit<u8>` because otherwise we'd have to construct a normal slice to uninitialized data, which is not desirable, I guess.

Several functions still have that [unneeded zeroing](https://rust.godbolt.org/z/5oKfMPo7j), but a single instruction is not that important, I guess.

`@rustbot` label T-libs C-optimization A-str
Diffstat (limited to 'compiler/rustc_middle/src/query/erase.rs')
0 files changed, 0 insertions, 0 deletions