Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ADVSIMD64 optimizations for System.Text.Encodings.Web#49847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@GrabYourPitchforks
Copy link
Member

This is a follow-up PR to#49373 which adds ARM64 SIMD optimizations to theFindFirstCharacterToEncode code paths. I'm not able to run BenchmarkDotNet on my SPX device for some reason, but I created a small console application to get some quick measurements.

Baseline (release/5.0):46 ns forHtmlEncoder.Default.FindFirstCharacterToEncodeUtf8(u8"The quick brown fox jumps over the lazy dog.")
advsimd-optimized:8.8 ns for same input. (-81% wall clock time taken)

The.AdvSimd64.cs file is basically a carbon copy of the.Ssse3.cs file, but using AMD64 patterns (tbl andaddp) instead of SSSE3 instructions (pshufb andpmovmskb).

We're relying on the increased unit test coverage given by the previous PR. I've also augmented the unit tests with an extra "insert this scurrilous BMP code point" check to validate that our UTF-16 -> ASCII conversion is working properly.

@ghost
Copy link

Tagging subscribers to this area:@tarekgh,@eiriktsarpalis,@layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

This is a follow-up PR to#49373 which adds ARM64 SIMD optimizations to theFindFirstCharacterToEncode code paths. I'm not able to run BenchmarkDotNet on my SPX device for some reason, but I created a small console application to get some quick measurements.

Baseline (release/5.0):46 ns forHtmlEncoder.Default.FindFirstCharacterToEncodeUtf8(u8"The quick brown fox jumps over the lazy dog.")
advsimd-optimized:8.8 ns for same input. (-81% wall clock time taken)

The.AdvSimd64.cs file is basically a carbon copy of the.Ssse3.cs file, but using AMD64 patterns (tbl andaddp) instead of SSSE3 instructions (pshufb andpmovmskb).

We're relying on the increased unit test coverage given by the previous PR. I've also augmented the unit tests with an extra "insert this scurrilous BMP code point" check to validate that our UTF-16 -> ASCII conversion is working properly.

Author:GrabYourPitchforks
Assignees:-
Labels:

area-System.Text.Encodings.Web

Milestone:-

@GrabYourPitchforks
Copy link
MemberAuthor

/cc@adamsitnik@DrewScoggins

Heads up that you're likely to see changes in the perf lab benchmarkhere and inSystem.Text.Json as a result of recent PRs.

adamsitnik reacted with thumbs up emoji

Copy link
Member

@eiriktsarpaliseiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks

@DrewScoggins
Copy link
Member

Thanks for the tag@GrabYourPitchforks. We will keep an eye out for this on Tuesday when we triage.

@GrabYourPitchforks
Copy link
MemberAuthor

GrabYourPitchforks commentedMar 20, 2021
edited
Loading

Green CI? Sure, I'll take it!
(If anybody has any extra comments, open a new issue or ping me offline and we can get them addressed in a future PR.)

@GrabYourPitchforksGrabYourPitchforks merged commit08d282c intodotnet:mainMar 20, 2021
@GrabYourPitchforksGrabYourPitchforks deleted the encoder_arm64_b branchMarch 20, 2021 00:33
@adamsitnik
Copy link
Member

I'm not able to run BenchmarkDotNet on my SPX device for some reason

@GrabYourPitchforks what error are you getting?

@ghostghost locked asresolvedand limited conversation to collaboratorsApr 21, 2021
@karelzkarelz added this to the6.0.0 milestoneMay 20, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@stephentoubstephentoubstephentoub left review comments

@tarekghtarekghtarekgh left review comments

@eiriktsarpaliseiriktsarpaliseiriktsarpalis approved these changes

@adamsitnikadamsitnikAwaiting requested review from adamsitnik

@layomialayomiaAwaiting requested review from layomia

@tannergoodingtannergoodingAwaiting requested review from tannergooding

Assignees

No one assigned

Projects

None yet

Milestone

6.0.0

Development

Successfully merging this pull request may close these issues.

8 participants

@GrabYourPitchforks@DrewScoggins@adamsitnik@stephentoub@eiriktsarpalis@tannergooding@tarekgh@karelz

[8]ページ先頭

©2009-2025 Movatter.jp