Skip to content

Evaluate using prefetching on slice's binary_search algorithm #37251

Closed
@gnzlbg

Description

@gnzlbg

This SO answer shows a 20% speed-up on binary_search with prefetching enabled at the cost of:

  • trashing at most 2 cache lines when an element is found (since two other elements will be prefetched),
  • increasing code-size with prefetching instructions.

We should consider adding this optimization if it turns out to be worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions