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

Change corelib to resx, strongly typed resources, and split resources for \shared #7643

Closed
2 of 5 tasks
danmoseley opened this issue Mar 16, 2017 · 7 comments
Closed
2 of 5 tasks
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@danmoseley
Copy link
Member

We need to

  • Change from .txt to .resx
  • Change to use SR.cs generated from .resx instead of GetResourceString("..")
  • Split the resx into two pieces, one in \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.
  • Do the same split in CoreRT
  • Enabling syncing for .resx files if it isn't already

@alexperovich this is just to track what we already discussed.

@alexperovich alexperovich self-assigned this Mar 17, 2017
@alexperovich alexperovich removed their assignment May 8, 2017
@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@MichalStrehovsky MichalStrehovsky added the linkable-framework Issues associated with delivering a linker friendly framework label Dec 16, 2020
@ghost
Copy link

ghost commented Dec 16, 2020

Tagging subscribers to 'linkable-framework': @eerhardt
See info in area-owners.md if you want to be subscribed.

Issue Details

We need to

  • Change from .txt to .resx
  • Change to use SR.cs generated from .resx instead of GetResourceString("..")
  • Split the resx into two pieces, one in \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.
  • Do the same split in CoreRT
  • Enabling syncing for .resx files if it isn't already

@alexperovich this is just to track what we already discussed.

Author: danmosemsft
Assignees: -
Labels:

area-Infrastructure-coreclr, linkable-framework, up-for-grabs

Milestone: Future

@MichalStrehovsky
Copy link
Member

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.

@eerhardt eerhardt modified the milestones: 6.0.0, Future May 11, 2021
@akoeplinger
Copy link
Member

akoeplinger commented Jan 10, 2024

@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?

@MichalStrehovsky
Copy link
Member

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.

@akoeplinger
Copy link
Member

@MichalStrehovsky ideally yes but it doesn't look like that will be happening soon: dotnet/linker#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?

@MichalStrehovsky
Copy link
Member

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!

@akoeplinger
Copy link
Member

Ok thanks, closing this issue then.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors linkable-framework Issues associated with delivering a linker friendly framework
Projects
Archived in project
Development

No branches or pull requests

6 participants