Skip to content

SmallVec<[u8; 16]>::clone is not optimized to a memcpy #260

@saethlin

Description

@saethlin

Playground example: https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=64230bf4215b7206e80b1f37198cf611

When I'm cloning a small SmallVec I don't mind this at all, but there should probably be a branch for the spilled case.


I'm not amazing at reading assembly but I think it's actually worse than "not a memcpy", pretty sure I see the increment for the SetLenOnDrop in there still 😬

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions