Closed danmoseley closed 9 months ago
Tagging subscribers to 'linkable-framework': @eerhardt See info in area-owners.md if you want to be subscribed.
Author: | danmosemsft |
---|---|
Assignees: | - |
Labels: | `area-Infrastructure-coreclr`, `linkable-framework`, `up-for-grabs` |
Milestone: | Future |
Bumping this to .NET 6 since this means that Mono CoreLib builds carry junk CoreCLR resource strings. #2151 made Mono just use the same RESX file as CoreCLR instead of doing a proper split.
@MichalStrehovsky I took a stab at this but realized that since we run the trimmer during the libraries build we end up stripping away the unused resources (edit only the properties, not the embedded resources). Do you still think it's worth doing the .resx file split?
It feels like it would be better if illinker learns how to remove unused strings automatically than doing this at build time. "Strings that are only used on CoreCLR" is no different from "strings that are only used in code paths that were trimmed". We use trimming in all scenarios that care about size.
@MichalStrehovsky ideally yes but it doesn't look like that will be happening soon: https://github.com/dotnet/linker/issues/2840
I realized that when testing my change I used a wasm app and that one sets UseSystemResourceKeys=true
so we remove the embedded resource and the trimmer trims away the unused C# properties completely hence why the size didn't change.
Just splitting up the .resx files makes the mono SPC ~30kB smaller on osx-arm64, or ~10kB for coreclr SPC.
Given that all the size-constrained platforms like wasm/ios/android set UseSystemResourceKeys=true
I'm not sure if that is worth it?
Just splitting up the .resx files makes the mono SPC ~30kB smaller on osx-arm64, or ~10kB for coreclr SPC.
Yeah, use cases that care about the 30 kB should all be setting UseSystemResourceKeys=true
. Agreed it doesn't look worth it. Thank you for measuring it!
Ok thanks, closing this issue then.
We need to
GetResourceString("..")
\shared\
that contains every string used in at least one place in any code in\shared\
, and another outside of\shared\
that contains all the other strings.@alexperovich this is just to track what we already discussed.