Skip to content

Easy performance improvements for vec_repeat() #1130

@mgirlich

Description

@mgirlich

vec_repeat() currently uses a combination of rep() and vec_slice(). It can be easily be made quite a bit faster by using vctrs::vec_rep() and vctrs::vec_rep_each().
This gives a nice speed up for expand_grid(), pivot_longer(), and pivot_wider().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions