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

Simplify intrinsic trimming #114

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Simplify intrinsic trimming #114

merged 1 commit into from
Jul 15, 2023

Conversation

Turnerj
Copy link
Owner

@Turnerj Turnerj commented Jul 15, 2023

Performance is up to 15% faster but the main benefit is simplified codegen as that will have a bigger impact on the overall calculation.

Before

Method Job Runtime TestString Mean Error StdDev Op/s Code Size Allocated
ForwardsTrim Framework .NET Framework 4.7.2 abcdefghij 6.938 ns 0.1753 ns 0.4133 ns 144,131,605.1 71 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcdefghij 9.927 ns 0.2467 ns 0.5816 ns 100,730,618.4 189 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcdefghij 10.022 ns 0.3716 ns 1.0359 ns 99,781,449.5 88 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcdefghij 10.249 ns 0.2463 ns 0.4627 ns 97,570,005.8 214 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [400] 19.667 ns 0.3660 ns 0.9513 ns 50,846,373.2 189 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [400] 26.456 ns 0.5387 ns 0.8699 ns 37,799,306.6 214 B -
ForwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [400] 192.588 ns 3.8581 ns 5.1505 ns 5,192,422.0 71 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [400] 258.642 ns 4.7046 ns 4.1705 ns 3,866,341.5 88 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [8000] 379.279 ns 7.4101 ns 6.5689 ns 2,636,581.4 189 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [8000] 512.274 ns 10.0105 ns 19.0460 ns 1,952,080.5 214 B -
ForwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [8000] 3,738.638 ns 73.9455 ns 117.2855 ns 267,477.1 71 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [8000] 5,021.090 ns 98.1290 ns 96.3758 ns 199,159.9 88 B -

After

Method Job Runtime TestString Mean Error StdDev Median Op/s Code Size Allocated
ForwardsTrim Framework .NET Framework 4.7.2 abcdefghij 6.184 ns 0.1438 ns 0.1201 ns 6.217 ns 161,695,239.3 69 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcdefghij 6.531 ns 0.1138 ns 0.0889 ns 6.515 ns 153,107,920.4 136 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcdefghij 9.228 ns 0.1155 ns 0.1024 ns 9.190 ns 108,365,437.6 88 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcdefghij 10.114 ns 0.1722 ns 0.1438 ns 10.130 ns 98,873,604.3 189 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [400] 18.727 ns 0.4055 ns 0.6069 ns 18.757 ns 53,399,469.7 136 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [400] 22.687 ns 0.4718 ns 0.5616 ns 22.884 ns 44,077,596.8 189 B -
ForwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [400] 166.039 ns 2.3966 ns 2.2418 ns 165.077 ns 6,022,681.8 69 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [400] 262.489 ns 5.1966 ns 6.9373 ns 261.323 ns 3,809,680.2 88 B -
ForwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [8000] 319.906 ns 6.1976 ns 6.0868 ns 320.138 ns 3,125,918.0 136 B -
BackwardsTrim Core (All Intrinsics) .NET 6.0 abcd(...)ghij [8000] 584.179 ns 49.5411 ns 146.0731 ns 523.157 ns 1,711,804.8 189 B -
ForwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [8000] 3,990.212 ns 72.1029 ns 67.4451 ns 4,000.487 ns 250,613.2 69 B -
BackwardsTrim Framework .NET Framework 4.7.2 abcd(...)ghij [8000] 6,005.445 ns 119.2689 ns 297.0209 ns 6,039.676 ns 166,515.6 88 B -

Performance is up to 15% faster but the main benefit is simplified codegen as that will have a bigger impact on the overall calculation
@Turnerj Turnerj added the enhancement New feature or request label Jul 15, 2023
@Turnerj Turnerj merged commit 90d9be5 into main Jul 15, 2023
@Turnerj Turnerj deleted the simplify-intrinsic-trimming branch July 15, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant