Skip to content

你好,请问二分查找时,这里为什么先从低32位开始查?有特殊考虑吗? #49

@byteroll

Description

@byteroll

ones := bits.OnesCount32(uint32(ww))

问了下gpt,说是"现代CPU对"从低位开始"的分支预测更友好",但是不确定是不是正确,想请教下作者本人。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions