-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Remove dependency on AppDomain from a hello world app #95710
Conversation
Saves 4% in size on a hello world. A hello world app will bring the `AppDomain` type with it. `AppDomain`'s `ToString` is quite expensive for what it does. Maybe this can be done cleaner, suggestions welcome.
It would be nice for scanner to figure out that |
I was digging into a compiler-side fix yesterday. The easy fix I tried was to help RyuJIT get rid of this branch.
As you say, we need to be able to get rid of this in the scanner. It's too late in RyuJIT. And we cannot get rid of this in the scanner, because the field is not read only. It can be considered read only once we finish whole program analysis. We'd need to run whole program analysis twice and then do this substitution when scanning the second time. Running whole program analysis twice is an option. It will be a significant compile throughput regression. We could potentially only do it when optimizing for size/speed and skip it in blended mode? |
It does not seem to be worth it. Here is a variant that leverages the fact that the ProcessExit events is exposed via AppDomain instance fields: main...jkotas:runtime:appdomain . It would work better in case we decide to fix the |
Yours looks much better! GitHub won't let me approve my own PR even though it's all your commit, so LGTM! |
Saves 4% in size on a hello world.
A hello world app will bring the
AppDomain
type with it.AppDomain
'sToString
is quite expensive for what it does.Maybe this can be done cleaner, suggestions welcome.
Cc @dotnet/ilc-contrib