Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CommonPrefixLength for SetOf sort validation #75851

Merged
merged 2 commits into from
Sep 19, 2022

Conversation

vcsjones
Copy link
Member

Since CommonPrefixLength is optimized and vectorized, this gives a small perf bump when validating ASN.1 SetOf sorting for "large" (greater than 16 elements). For small inputs the perf change is negligible.

Note in the table below for SetOf_CorrectSort, it shows as being 1ns slower, but other runs it ends up coming out faster, but all within a ns of each other.

Method Job Toolchain Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
SetOf_Empty Job-GLTSSG branch 11.96 ns 0.016 ns 0.013 ns 1.00 - - - -
SetOf_Empty Job-AXNJXB main 11.95 ns 0.003 ns 0.002 ns 1.00 - - - -
SetOf_IncorrectSort Job-GLTSSG branch 13,903.47 ns 9.506 ns 8.427 ns 1.00 0.0458 - - 320 B
SetOf_IncorrectSort Job-AXNJXB main 13,928.41 ns 10.076 ns 8.414 ns 1.00 0.0458 - - 320 B
SetOf_LargeIncorrectSort Job-GLTSSG branch 13,762.73 ns 12.703 ns 11.261 ns 0.99 0.0458 - - 320 B
SetOf_LargeIncorrectSort Job-AXNJXB main 13,892.17 ns 11.766 ns 10.430 ns 1.00 0.0458 - - 320 B
SetOf_CorrectSort Job-GLTSSG branch 35.48 ns 0.033 ns 0.027 ns 1.12 - - - -
SetOf_CorrectSort Job-AXNJXB main 34.48 ns 0.040 ns 0.038 ns 1.00 - - - -
SetOf_LargeCorrectSort Job-GLTSSG branch 43.50 ns 0.137 ns 0.128 ns 0.82 - - - -
SetOf_LargeCorrectSort Job-AXNJXB main 53.04 ns 0.046 ns 0.043 ns 1.00 - - - -

@ghost
Copy link

ghost commented Sep 19, 2022

Tagging subscribers to this area: @dotnet/area-system-formats-asn1, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

Since CommonPrefixLength is optimized and vectorized, this gives a small perf bump when validating ASN.1 SetOf sorting for "large" (greater than 16 elements). For small inputs the perf change is negligible.

Note in the table below for SetOf_CorrectSort, it shows as being 1ns slower, but other runs it ends up coming out faster, but all within a ns of each other.

Method Job Toolchain Mean Error StdDev Ratio Gen 0 Gen 1 Gen 2 Allocated
SetOf_Empty Job-GLTSSG branch 11.96 ns 0.016 ns 0.013 ns 1.00 - - - -
SetOf_Empty Job-AXNJXB main 11.95 ns 0.003 ns 0.002 ns 1.00 - - - -
SetOf_IncorrectSort Job-GLTSSG branch 13,903.47 ns 9.506 ns 8.427 ns 1.00 0.0458 - - 320 B
SetOf_IncorrectSort Job-AXNJXB main 13,928.41 ns 10.076 ns 8.414 ns 1.00 0.0458 - - 320 B
SetOf_LargeIncorrectSort Job-GLTSSG branch 13,762.73 ns 12.703 ns 11.261 ns 0.99 0.0458 - - 320 B
SetOf_LargeIncorrectSort Job-AXNJXB main 13,892.17 ns 11.766 ns 10.430 ns 1.00 0.0458 - - 320 B
SetOf_CorrectSort Job-GLTSSG branch 35.48 ns 0.033 ns 0.027 ns 1.12 - - - -
SetOf_CorrectSort Job-AXNJXB main 34.48 ns 0.040 ns 0.038 ns 1.00 - - - -
SetOf_LargeCorrectSort Job-GLTSSG branch 43.50 ns 0.137 ns 0.128 ns 0.82 - - - -
SetOf_LargeCorrectSort Job-AXNJXB main 53.04 ns 0.046 ns 0.043 ns 1.00 - - - -
Author: vcsjones
Assignees: -
Labels:

area-System.Formats.Asn1

Milestone: -

@vcsjones vcsjones merged commit af1e6ba into dotnet:main Sep 19, 2022
@vcsjones vcsjones deleted the setof-sort-cpl branch September 19, 2022 21:36
@ghost ghost locked as resolved and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants