-
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
R2R image of SPC has many costly ValueTuple methods #76513
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I think this idea will become even more interesting after #75793 gets in and we only root public (or possibly-public) surface area. |
This leads to partially pre-compiling CoreLib using PGO data. I do not think we would want to maintain the list of what's not worth pre-compiling by hand. We have experimented with partially compiling CoreLib based on PGO data in the past. Unfortunately, we have seen measurable regressions in number of cases. The problem is that each application uses a substantially different set of one-off methods from CoreLib. We may want to redo the experiments with partially precompiling CoreLib to see where we would be landing with the current state of tiered JIT. |
I think certainly the heuristics of how generic methods are instantiated can be improved. For example, I don't think it makes sense to instantiate 21-ary value tuple method with 21 instances of |
I know this has had a few milestone bounces, but I think it would be interesting for us to look at in .NET 10. |
I noticed that we spend a lot of JIT time and image size on
ValueTuple
methods in R2R:https://gist.github.com/jakobbotsch/84a4525207268577fddb1b174b8ea63d
It seems these end up being rooted due to e.g.
runtime/src/libraries/System.Private.CoreLib/src/System/TupleExtensions.cs
Lines 679 to 689 in 144a33a
Skipping
ToValueTuple
andToTuple
methods avoids the root and reduces the size of SPC by around 2% on win-x64. It feels like a safe bet that most of these overloads are not going to be used in most applications, so skipping them would be fruitful in terms of deployment size.It would also be nice to collect some data such as "X method is responsible for rooting Y bytes in the final image" and see if there are more cases like this that we should consider skipping.
The text was updated successfully, but these errors were encountered: