Skip to content

Optimize System.Text.ASCIIUtility for arm64 using cross-platform intrinsics #41292

Description

@jeffhandley

This item tracks the remaining System.Text.ASCIIUtility methods that can be optimized for ARM64 using intrinsics. Many were completed in 5.0.0 with #35034, but two methods remain. Both of them had prior attempts to apply ARM64 intrinsics, but the efforts were not completed.

Update for .NET 7
Now that we have cross-platform intrinsics APIs (#49397), these optimizations should be completed using those APIs instead of adding ARM64-specific intrinsics code paths. The effort could optionally include first measuring performance of these methods with the ARM64-specific intrinsics in place, and then measuring the performance of these methods with the cross-platform intrinsics.

We previously attempted to implement these optimizations during .NET 5, but the draft PRs linked above were closed because they were introducing unexpected regressions. Therefore, the effort on these optimizations must include investigation of those pitfalls and finding an approach that simultaneously optimizes the code for ARM64 and avoids regressions elsewhere.

Example use of the new cross-platform intrinsics: #63722

Activity

  1. added this to the 6.0.0 milestone on Aug 24, 2020
  2. added
    untriaged
    on Aug 24, 2020
  3. removed
    untriaged
    on Aug 24, 2020
  4. tarekgh commented on Aug 25, 2020

    @tarekgh
    Member
  5. added
    Priority:3
    on Jan 14, 2021
  6. added
    Cost:S
    on Jan 15, 2021
  7. 8 remaining items

  8. added
    Cost:M
    and removed
    Cost:S
    on Feb 23, 2022
  9. a74nh commented on May 3, 2022

    @a74nh
    Contributor

    Could you please assign this to @SwapnilGaikwad

  10. ghost added
    in-pr
    on Jun 1, 2022
  11. ghost removed
    in-pr
    on Jun 30, 2022
  12. danmoseley commented on Jun 30, 2022

    @danmoseley
    Contributor

    @kunalspathak with the attached change is this now addressed for all architectures, or should this remain open?

  13. a74nh commented on Jun 30, 2022

    @a74nh
    Contributor

    System.Text.ASCIIUtility.GetIndexOfFirstNonAsciiChar() is done for Arm64/X64.

    Expecting a pull request for System.Text.ASCIIUtility.NarrowUtf16ToAscii() to be raised late this week/early next week.

  14. kunalspathak commented on Jun 30, 2022

    @kunalspathak
    Contributor

    System.Text.ASCIIUtility.GetIndexOfFirstNonAsciiChar() is done for Arm64/X64.

    Expecting a pull request for System.Text.ASCIIUtility.NarrowUtf16ToAscii() to be raised late this week/early next week.

    It's other way round. NarrowUtf16ToAscii() is complete and System.Text.ASCIIUtility.GetIndexOfFirstNonAsciiChar() is not yet complete.

  15. a74nh commented on Jun 30, 2022

    @a74nh
    Contributor

    It's other way round. NarrowUtf16ToAscii() is complete and System.Text.ASCIIUtility.GetIndexOfFirstNonAsciiChar() is not yet complete.

    Oops, yes :)

  16. ghost added
    in-pr
    on Jul 5, 2022
  17. ghost removed
    in-pr
    on Jul 7, 2022
  18. ghost locked as resolved and limited conversation to collaborators on Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Cost:MPriority:3arch-arm64area-System.Text.Encoding

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions