-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Reduce binary size by moving data definitions out of headers. #40254
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
On Windows X64 release, this reduces coreclr.dll by 186kb and clrjit by 10kb. The big reduction comes from On Linux x64 release, this reduces libcorclr.so by 8kb and libmscordbi.so by 23kb. I added some new .cpp files because I was not sure if there was a better place to put the prime numbers. |
@janvorli Is there anything left in this change that you have not addressed already? |
9e6a0b4
to
113e127
Compare
@jkotas It looks like @janvorli got almost everything. The only remaining item is The I have rebased. |
Great, I have missed the fact that we already have a shared .cpp file between the debug/ee and debug/di, using the trick of #including a .cpp file to solve the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Hi! We use some subset of coreclr headers for Profiling API decls (discussed here #11397), but after moving Are there any other options to keep cor.h independent of other internals? @janvorli @jkotas I checked that this way works fine and that symbols didn't get duplicated on Linux:
|
…on to keep its definition in cor.h Fixes undefined references to g_tkCorEncodeToken when using CorSigCompressToken() in user projects with shared Profiling API headers like cor.h / corprof.h See dotnet#40254 (comment).
…on to keep its definition in cor.h (#41797) Fixes undefined references to g_tkCorEncodeToken when using CorSigCompressToken() in user projects with shared Profiling API headers like cor.h / corprof.h See #40254 (comment). Co-authored-by: Jan Kotas <[email protected]>
Contributes to #39599