Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

GrabYourPitchforks
Copy link
Member

Issue dotnet/runtime#2251 reports that on AMD processors, we severely regressed some UTF-8 transcoding code paths on AMD processors. These processors have unoptimized implementations of the pdep/pext intrinsic. We didn't see this earlier because my benchmarking machine uses an Intel processor.

This has already been fixed in .NET 5 (see dotnet/runtime#31904). This PR ports that fix down to release/3.1.

Customer Impact

Significant slowdowns in UTF-8 transcoding performance on 3.0 compared to 2.1 when using an AMD processor and where the input to transcode has mixed ASCII and non-ASCII data.

Regression?

Perf regression between 2.1 and 3.0. Not a functional regression.

Testing

Fix has been perf tested (see dotnet/runtime#31904 (comment)) and fuzzed (see dotnet/runtime#31904 (comment)).

Risk

Low. No functional changes; only performance changes. We have excellent unit test coverage and fuzzer coverage over this code.

Code Reviewer

@tannergooding

Remove BMI2 from ASCII and UTF-16 processing hot paths, as not all processors have optimized implementations of pext/pdep
@GrabYourPitchforks GrabYourPitchforks added area-System.Runtime Servicing-consider Issue for next servicing release review labels Feb 11, 2020
@GrabYourPitchforks GrabYourPitchforks added this to the 3.1.x milestone Feb 11, 2020
@GrabYourPitchforks GrabYourPitchforks changed the title Port dotnet/runtime#31904 to release/3.1 [release/3.1] Port dotnet/runtime#31904 fix for slow UTF-8 transcoding performance Feb 11, 2020
@GrabYourPitchforks
Copy link
Member Author

Approved via email.

@GrabYourPitchforks GrabYourPitchforks added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 15, 2020
@GrabYourPitchforks GrabYourPitchforks modified the milestones: 3.1.x, 3.1.3 Feb 15, 2020
@Anipik Anipik merged commit a74f1db into dotnet:release/3.1 Feb 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants