Skip to content

char::is_ascii_digit() is slower than char::is_digit(10) #68453

Closed
@ThomasdenH

Description

@ThomasdenH

Using the method is_ascii_digit on a char is about 17% slower than using is_digit(10). I wouldn't expect there to be a difference, of if there was, I would expect the former to be faster. Could this be improved or are the two not actually equivalent?

Activity

ThomasdenH

ThomasdenH commented on Jan 22, 2020

@ThomasdenH
Author

I just saw #67143, which I think fixes this.

blankname

blankname commented on Jan 25, 2020

@blankname

Might want to re-open this as #67143 has been closed.

ThomasdenH

ThomasdenH commented on Jan 25, 2020

@ThomasdenH
Author

Alright.

LeSeulArtichaut

LeSeulArtichaut commented on Feb 19, 2020

@LeSeulArtichaut
Contributor

This seems like a duplicate of #65127, which has been fixed by #67585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @blankname@Alexendoo@ThomasdenH@LeSeulArtichaut

        Issue actions

          `char::is_ascii_digit()` is slower than `char::is_digit(10)` · Issue #68453 · rust-lang/rust