Skip to content

Lock step loop codegen issue #38175

Closed
Closed
@bluss

Description

@bluss

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions