Skip to content

runtime: use tophash == emptyRest to decrease search times in mapaccess1_faststr and mapaccess2_faststr #68912

Open
@yuanjize

Description

@yuanjize

Proposal Details

In function mapaccess2_faststr and mapaccess2_faststr , I think we can add follow code in dohash block to decrease the search in bucket & over flow buckets.

   if b.tophash[i] == emptyRest {
       return unsafe.Pointer(&zeroVal[0])
   }

Position:

k := (*stringStruct)(kptr)

I am pleasure to change it if you think it is good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions