Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Jul 2, 2025

Noticed a couple of these in a log.

Cc @dotnet/ilc-contrib

Something I noticed in a log. Wonder if it's meaningful.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@MichalStrehovsky
Copy link
Member Author

0.2% on a minimal Kestrel app. Maybe worth the two lines. Not likely to cause trouble in the future.

Size statistics

Pull request #117238

Project Size before Size after Difference
TodosApi-linux 25509440 25493056 -16384
TodosApi-windows 22878208 22865408 -12800
avalonia.app-linux 19937856 19933760 -4096
avalonia.app-windows 17597952 17595904 -2048
hello-linux 1369040 1369040 0
hello-minimal-linux 1086248 1086248 0
hello-minimal-windows 837632 837632 0
hello-windows 1092608 1092608 0
kestrel-minimal-linux 5180760 5172568 -8192
kestrel-minimal-windows 4726272 4723712 -2560
reflection-linux 2001632 2001632 0
reflection-windows 1704448 1704448 0
webapiaot-linux 9837496 9829304 -8192
webapiaot-windows 9005056 8999936 -5120
winrt-component-full-windows 5727232 5726720 -512
winrt-component-minimal-windows 1703936 1703424 -512

@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review July 2, 2025 11:31
Copilot AI review requested due to automatic review settings July 2, 2025 11:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the value-type helper logic to skip generating __GetFieldHelper for System.ValueTuple types.

  • Adds a special-case check to bypass helper generation for any ValueTuple in the System module.
  • Returns false early to avoid the default bit-comparison infrastructure.
Comments suppressed due to low confidence (1)

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/CompilerTypeSystemContext.ValueTypeMethods.cs:106

  • Add a unit test that verifies ValueTuple types bypass the __GetFieldHelper path to ensure this special case isn’t accidentally removed in future refactorings.
            if (valueType.Module == SystemModule && valueType.Name.StartsWith("ValueTuple`", StringComparison.OrdinalIgnoreCase) && valueType.Namespace == "System")

…eSystemContext.ValueTypeMethods.cs

Co-authored-by: Copilot <[email protected]>
@rhuijben
Copy link
Contributor

rhuijben commented Jul 3, 2025

I see a few more recently added types missing in the lists for explicit skip. Double and Single are specialized but Half isn't. There are probably more, but not sure if you gain as much as for generic types.

@MichalStrehovsky
Copy link
Member Author

Double and Single are there because that's the legacy logic that has been in use for ValueType.Equals/GetHashCode since forever. It was never updated for the new floating point types (not on AOT side, not on JIT side). We recommend everyone to steer clear of the base ValueType.Equals/GetHashCode and provide their own override.

@jkotas jkotas added the tenet-performance Performance related issue label Jul 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants