Closed
Description
The original issue is the performance regression in #38021 when using the TrustedLen specialization of Extend<&T> for Vec
.
In pseudocode you can describe their difference like this:
extend_from_slice:
for i in 0..len {
dst[i] = src[i];
}
extend/TrustedLen:
while src != src_end {
*dst++ = *src++;
}
A reduced case to demonstrate the issue is https://gist.github.com/bluss/61c32daae1bd31d9d7605983df3ace5f