Skip to content

<xutility>: copy and fill family could engage memcpy / memset in more cases #431

@BillyONeal

Description

@BillyONeal

As @CaseyCarter indicated over in #425 (comment) we could engage the memcpy and memset optimization for in more cases, when we can determine that the effective static_cast to unsigned char inside memset is equivalent to what happens during each assignment.

For example, copy / fill bools over chars.

See also a similar case reported on Reddit at reported on https://www.reddit.com/r/cpp/comments/erialk/the_hunt_for_the_fastest_zero/ where we should be able to use memset for any scalar input to allow the optimization to engage for fill(char*, char*, 0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!performanceMust go faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions