Skip to content

strings: Index(s, "x") not as optimized as bytes.IndexByte #3751

Description

@bradfitz
bytes.IndexByte is implemented in assembly:

http://golang.org/pkg/bytes/#IndexByte

The strings package lacks an IndexByte method.  It does have a special case for Index
when len(sep) == 1, but not in assembly:

http://golang.org/src/pkg/strings/strings.go?s=1834:1863#L71

Low priority, but inconsistent. I noticed a couple weeks ago when I was looking at some
profiles.

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions