-
Notifications
You must be signed in to change notification settings - Fork 510
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
Make ObjCRuntime.Runtime.Arch a constant for the AOT compiler #5518
Comments
Where are the savings coming from ? The linker optimize that (at least in bindings) before it reach the AOT compiler (so the field should not be present). If the saving comes from elsewhere then we could expand on this (linker) optimization. Or maybe we can shadow the current field with a 2nd (read-only) one ? and make sure the platform assemblies (and generated code?) use this field. Of course existing (3rd party) bindings won't make use of the new field and won't have this optimizations. Recompiling them would make them incompatible with earlier versions too :| Now It could be |
This is
That's an intriguing idea. |
Ok, still make sense for Don't link wrt the interpreter, at least until we revisit all the linker optimizations :) |
. * Make Runtime.Arch a readonly field. * Tell the AOT compiler Runtime.Arch is a constant value. * Tell the linker to stub out the method we use to fetch the current architecture from native code (it turned out a bit complicated to set the Arch field when it's readonly - the solution I came up with was to call a P/Invoke). Test case (size of the main executable): link all (debug) * Before: 33.522.704 bytes * After: 33.506.112 bytes * Difference: -16.592 bytes (-0.05 %) There were no size differences in release mode, nor were there any size differences in the "don't link" test, neither for debug nor release mode. Fixes xamarin#5518.
…14076) * Make Runtime.Arch a readonly field. * Tell the AOT compiler Runtime.Arch is a constant value. * Tell the linker to stub out the method we use to fetch the current architecture from native code (it turned out a bit complicated to set the Arch field when it's readonly - the solution I came up with was to call a P/Invoke). Test case (size of the main executable): link all (debug) * Before: 33.522.704 bytes * After: 33.506.112 bytes * Difference: -16.592 bytes (-0.05 %) There were no size differences in release mode, nor were there any size differences in the "don't link" test, neither for debug nor release mode. Fixes #5518.
Suggestion:
ARCH.Device = 0
), which will allow the AOT compiler to skip a lot of dead code (all the simulator-only code can be optimized away).Requirements:
POC: rolfbjarne@84f35cf
POC result: The don't link app compiled for iOS/arm64 is ~175kb smaller.
The text was updated successfully, but these errors were encountered: