-
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
[mono] Investigate performance impact of using interpreter as the default fallback for generics instead of GSHAREDVT methods #71482
Comments
Tagging subscribers to this area: @BrzVlad Issue DetailsWhile investigating app size differences between legacy and .NET 7 mono for iOS, it has been seen that
bloaty -d segments,sections,symbols,compileunits --debug-file=dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app.dSYM/Contents/Resources/DWARF/MySingleView dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > ../logs/dotnet_symbols_s.list which shows
bloaty -d segments,sections,symbols,compileunits --debug-file=dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app.dSYM/Contents/Resources/DWARF/MySingleView dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView --source-filter GSHAREDVT > ../logs/dotnet_symbols_gshared.list which shows Since these methods are large and slow, and are used only as a fallback when generic value type cannot be determined it would be valuable to investigate the impact of replacing them with the interpreter as the default fallback. The impact of this change should be tested for:
cc @BrzVlad
|
Similar results have been observed by measuring the size of the
These results can be obtained with the following steps: curl -o dotnet-sdk-7.0.100-preview.6.22316.8-osx-arm64.tar.gz https://dotnetbuilds.azureedge.net/public/Sdk/7.0.100-preview.6.22316.8/dotnet-sdk-7.0.100-preview.6.22316.8-osx-arm64.tar.gz
mkdir dotnet7
tar -xvf dotnet-sdk-7.0.100-preview.6.22316.8-osx-arm64.tar.gz -C dotnet7
cd dotnet7
./dotnet workload install maui --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.0/preview.6.json
./dotnet new maui -n "MyMauiApp"
cd MyMauiApp
../dotnet publish -f net7.0-ios -r ios-arm64 -c Release and retrieving the symbol sizes with
bloaty -d segments,sections,symbols --debug-file=bin/Release/net7.0-ios/ios-arm64/MyMauiApp.app.dSYM/Contents/Resources/DWARF/MyMauiApp bin/Release/net7.0-ios/ios-arm64/MyMauiApp.app/MyMauiApp -n 0 > MyMauiApp_symbols.list which shows
bloaty -d segments,sections,symbols --debug-file=bin/Release/net7.0-ios/ios-arm64/MyMauiApp.app.dSYM/Contents/Resources/DWARF/MyMauiApp bin/Release/net7.0-ios/ios-arm64/MyMauiApp.app/MyMauiApp -n 0 --source-filter GSHAREDVT > MyMauiApp_GSHAREDVT_symbols.list which shows |
Moving this to 8.0.0 with a possibility we may backport changes if this has significant perf improvements. |
It is important to note that enabling interpreter also affects the final bundle size in the following ways:
The first two points should not have a big impact on the overall size (at least compared to the size of GSHAREDVT methods). However, the last point has significant impact. For example:
Considering just However, it might be possible to make ILStripping more sophisticated and strip all the IL code except for the generic methods for which MonoAOT would generate GSHAREDVTs. It might be beneficial to repeat the experiment once such improvements are introduced. |
Moving to 9.0.0 |
While investigating app size differences between legacy and .NET 7 mono for iOS, it has been seen that
GSHAREDVT
methods take up around5%
of the__text
size.This can be observed by following the steps from the above-mentioned issue to generate binaries, and running
bloaty
with:bloaty -d segments,sections,symbols,compileunits --debug-file=dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app.dSYM/Contents/Resources/DWARF/MySingleView dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > ../logs/dotnet_symbols_s.list
which shows
4.73Mb
of the__text
sectionbloaty -d segments,sections,symbols,compileunits --debug-file=dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app.dSYM/Contents/Resources/DWARF/MySingleView dotnet/bin/iPhone/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView --source-filter GSHAREDVT > ../logs/dotnet_symbols_gshared.list
which shows
258Ki
of the__text
sectionSince these methods are large and slow, and are used only as a fallback when generic value type cannot be determined it would be valuable to investigate the impact of replacing them with the interpreter as the default fallback.
The impact of this change should be tested for:
cc @BrzVlad
The text was updated successfully, but these errors were encountered: