Skip to content

Save unnecessary RuneCountInString #53942

@ekexium

Description

@ekexium

Enhancement

RuneCountInString can be unexpectedly time-consuming for certain workloads. Since the number of runes must be smaller than or equal to the length of the string, we can fast check the length first. Only calculate the number of runes when necessary.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementThe issue or PR belongs to an enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions