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

TypeName.FullName: reduce allocations #112350

Merged
merged 4 commits into from
Feb 12, 2025
Merged

Conversation

adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Feb 10, 2025

For the benchmarks from dotnet/performance#4699:

Method Toolchain input Mean Ratio Allocated Alloc Ratio
ParseAndGetFullName main System.Colle(...)][,][][]]][] [169] 5,446.40 ns 1.00 12634 B 1.00
ParseAndGetFullName #112242 System.Colle(...)][,][][]]][] [169] 5,631.43 ns 1.03 7169 B 0.57
ParseAndGetFullName #112350 System.Colle(...)][,][][]]][] [169] 4,692.92 ns 0.86 5761 B 0.46
ParseAndGetFullName main System.Collec(...)stem.Boolean] [69] 1,902.67 ns 1.00 2968 B 1.00
ParseAndGetFullName #112242 System.Collec(...)stem.Boolean] [69] 2,213.91 ns 1.16 2712 B 0.91
ParseAndGetFullName #112350 System.Collec(...)stem.Boolean] [69] 1,765.22 ns 0.93 2080 B 0.70
ParseAndGetFullName main System.Collec(...)em.Boolean][] [71] 1,984.31 ns 1.00 3592 B 1.00
ParseAndGetFullName #112242 System.Collec(...)em.Boolean][] [71] 2,253.78 ns 1.14 2800 B 0.78
ParseAndGetFullName #112350 System.Collec(...)em.Boolean][] [71] 1,901.69 ns 0.96 2168 B 0.60
ParseAndGetFullName main System.Int32 54.35 ns 1.00 128 B 1.00
ParseAndGetFullName #112242 System.Int32 56.34 ns 1.04 128 B 1.00
ParseAndGetFullName #112350 System.Int32 52.82 ns 0.97 128 B 1.00
ParseAndGetFullName main System.Int32& 123.92 ns 1.00 256 B 1.00
ParseAndGetFullName #112242 System.Int32& 161.24 ns 1.30 328 B 1.28
ParseAndGetFullName #112350 System.Int32& 126.47 ns 1.02 256 B 1.00
ParseAndGetFullName main System.Int32* 123.48 ns 1.00 256 B 1.00
ParseAndGetFullName #112242 System.Int32* 166.32 ns 1.35 328 B 1.28
ParseAndGetFullName #112350 System.Int32* 128.26 ns 1.04 256 B 1.00
ParseAndGetFullName main System.Int32[*] 130.00 ns 1.00 264 B 1.00
ParseAndGetFullName #112242 System.Int32[*] 165.89 ns 1.28 336 B 1.27
ParseAndGetFullName #112350 System.Int32[*] 133.72 ns 1.03 264 B 1.00
ParseAndGetFullName main System.Int32[,] 135.18 ns 1.00 264 B 1.00
ParseAndGetFullName #112242 System.Int32[,] 169.61 ns 1.26 336 B 1.27
ParseAndGetFullName #112350 System.Int32[,] 138.54 ns 1.03 264 B 1.00
ParseAndGetFullName main System.Int32[] 123.53 ns 1.00 264 B 1.00
ParseAndGetFullName #112242 System.Int32[] 170.11 ns 1.38 336 B 1.27
ParseAndGetFullName #112350 System.Int32[] 129.22 ns 1.05 264 B 1.00
ParseAndGetFullName main System.Reflec(...)peName+Nested [47] 97.29 ns 1.00 352 B 1.00
ParseAndGetFullName #112242 System.Reflec(...)peName+Nested [47] 94.01 ns 0.97 352 B 1.00
ParseAndGetFullName #112350 System.Reflec(...)peName+Nested [47] 101.78 ns 1.05 352 B 1.00
ParseAndGetFullName main System.Reflec(...)stem.Boolean] [93] 2,008.11 ns 1.00 3296 B 1.00
ParseAndGetFullName #112242 System.Reflec(...)stem.Boolean] [93] 2,428.41 ns 1.21 3040 B 0.92
ParseAndGetFullName #112350 System.Reflec(...)stem.Boolean] [93] 1,854.19 ns 0.92 2408 B 0.73

@adamsitnik adamsitnik added this to the 10.0.0 milestone Feb 10, 2025
@adamsitnik adamsitnik requested a review from jkotas February 10, 2025 11:48
@adamsitnik adamsitnik self-assigned this Feb 10, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Other than the pending comments, LGTM

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you

@jkotas jkotas merged commit 92b4704 into dotnet:main Feb 12, 2025
81 of 85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants