Skip to content

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

Description

As Casey Carter (@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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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