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

Add 'EnableDefaultCustomTypeMappings' switch #1483

Merged
merged 20 commits into from
Feb 2, 2024

Conversation

Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented Jan 30, 2024

We have a fair amount of binary size being used up due to all the default ABI type mappings from Projections's type initializer, which ends up rooting a whole lot of stuff even if not actually used. This PR adds a new CsWinRTEnableDefaultCustomTypeMappings property (defaults to true to keep the current behavior), which allows developers to disable this behavior and trim all of that additional infrastructure. We should evaluate the best way to allow devs to then manually register the individual types they need. That could be via some new RegisterAbiTypeMapping-like methods or something.

sizoscope diff incoming...

@Sergio0694
Copy link
Member Author

Saves 586 KB on .NET 9, as a baseline (!!!):

image

@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/default-mappings-switch branch from 7ccc47c to a104cc2 Compare January 31, 2024 01:40
@Sergio0694 Sergio0694 marked this pull request as ready for review January 31, 2024 15:57
@Sergio0694
Copy link
Member Author

Updated diff with the default always-on mappings, and the extra guard code, 583 KB saved on .NET 9:

image

@Sergio0694 Sergio0694 merged commit 6251818 into staging/AOT Feb 2, 2024
9 checks passed
@Sergio0694 Sergio0694 deleted the user/sergiopedri/default-mappings-switch branch February 2, 2024 19:17
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.

2 participants