Skip to content

Provide an intentional (mis)alignment that corresponds to typical usage in benchmarks for plain arrays #5035

@AlexGuteniev

Description

@AlexGuteniev

Results on my 5950X:

A big difference in "After" columnbetween std_swap<9000, uint8_t> and std_swap_ranges<uint8_t>/9000 made me curious. It is big for me too.

Looks like the main reason is vector over-alignment. adding alignas(64) to stack array makes significant improvement there.

I don't think the benchmark should be modified to have that though.

If we know that alignment has a significant effect on the results, shouldn't we control it instead of letting it vary and skew the benchmark? Note that "control" doesn't mean "pick an unrealistic value that skews the results" but either pick a value that is representative or average over a set of values that are representative.

Originally posted by @CaseyCarter in #4991 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedSomething works now, yay!testRelated to test code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions