[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

[illink] Set runtime libraries feature switches defaults - #5337

Merged
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults
Dec 1, 2020
Merged

[illink] Set runtime libraries feature switches defaults#5337
radekdoulik merged 4 commits into
dotnet:masterfrom
radekdoulik:pr-illink-feature-switches-defaults

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Set all current feature switches, but InvariantGlobalization, to
defaults which trim the features.

Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md

Difference in assembly size of XA BuildReleaseArm64False test before/after:

Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)

Set all current feature switches, but `InvariantGlobalization`, to
defaults which trim the features.
Context: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Difference in apk size of XA BuildReleaseArm64False test before/after:
Summary:
- 417,632 Assemblies -15.98% (of 2,613,075)
@radekdoulik

Copy link
Copy Markdown
MemberAuthor

Detailed comparison of the above mentioned apks

apkdiff -v -f -e dll bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
Loading apk 'bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
3090 assemblies/UnnamedProject.dll
3907 assemblies/Microsoft.Win32.Primitives.dll
14620 assemblies/System.Collections.Concurrent.dll
9962 assemblies/System.Collections.NonGeneric.dll
11959 assemblies/System.Collections.dll
4598 assemblies/System.ComponentModel.Primitives.dll
9754 assemblies/System.Console.dll
29064 assemblies/System.Diagnostics.DiagnosticSource.dll
29154 assemblies/System.Formats.Asn1.dll
13539 assemblies/System.IO.Compression.Brotli.dll
23012 assemblies/System.IO.Compression.dll
27844 assemblies/System.IO.FileSystem.dll
137374 assemblies/System.Linq.Expressions.dll
19966 assemblies/System.Linq.dll
241474 assemblies/System.Net.Http.dll
13562 assemblies/System.Net.NameResolution.dll
19523 assemblies/System.Net.NetworkInformation.dll
45803 assemblies/System.Net.Primitives.dll
38243 assemblies/System.Net.Quic.dll
84589 assemblies/System.Net.Security.dll
66350 assemblies/System.Net.Sockets.dll
7462 assemblies/System.ObjectModel.dll
42614 assemblies/System.Private.Uri.dll
12559 assemblies/System.Private.Xml.Linq.dll
304668 assemblies/System.Private.Xml.dll
1730 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3392 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
23083 assemblies/System.Runtime.Numerics.dll
7156 assemblies/System.Runtime.Serialization.Formatters.dll
2895 assemblies/System.Runtime.Serialization.Primitives.dll
47186 assemblies/System.Security.Cryptography.Algorithms.dll
14530 assemblies/System.Security.Cryptography.Encoding.dll
17874 assemblies/System.Security.Cryptography.OpenSsl.dll
11589 assemblies/System.Security.Cryptography.Primitives.dll
101449 assemblies/System.Security.Cryptography.X509Certificates.dll
55708 assemblies/System.Text.RegularExpressions.dll
16356 assemblies/System.Threading.Channels.dll
820003 assemblies/System.Private.CoreLib.dll
74995 assemblies/Java.Interop.dll
18764 assemblies/Mono.Android.Export.dll
181675 assemblies/Mono.Android.dll
18104 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Loading apk '.\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk'
2584 AndroidManifest.xml
2200 res/drawable-mdpi-v4/icon.png
4791 res/drawable-hdpi-v4/icon.png
7462 res/drawable-xhdpi-v4/icon.png
13092 res/drawable-xxhdpi-v4/icon.png
20118 res/drawable-xxxhdpi-v4/icon.png
544 res/layout/main.xml
1724 resources.arsc
317096 classes.dex
2956 assemblies/UnnamedProject.dll
3835 assemblies/Microsoft.Win32.Primitives.dll
10828 assemblies/System.Collections.Concurrent.dll
7479 assemblies/System.Collections.NonGeneric.dll
8526 assemblies/System.Collections.dll
3194 assemblies/System.ComponentModel.Primitives.dll
5958 assemblies/System.Console.dll
26633 assemblies/System.Formats.Asn1.dll
11943 assemblies/System.IO.Compression.Brotli.dll
19223 assemblies/System.IO.Compression.dll
24112 assemblies/System.IO.FileSystem.dll
115284 assemblies/System.Linq.Expressions.dll
18219 assemblies/System.Linq.dll
214315 assemblies/System.Net.Http.dll
9063 assemblies/System.Net.NameResolution.dll
18198 assemblies/System.Net.NetworkInformation.dll
42522 assemblies/System.Net.Primitives.dll
37061 assemblies/System.Net.Quic.dll
67928 assemblies/System.Net.Security.dll
55915 assemblies/System.Net.Sockets.dll
5153 assemblies/System.ObjectModel.dll
40584 assemblies/System.Private.Uri.dll
10317 assemblies/System.Private.Xml.Linq.dll
250680 assemblies/System.Private.Xml.dll
1666 assemblies/System.Runtime.CompilerServices.Unsafe.dll
3007 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
21740 assemblies/System.Runtime.Numerics.dll
2648 assemblies/System.Runtime.Serialization.Formatters.dll
2583 assemblies/System.Runtime.Serialization.Primitives.dll
40626 assemblies/System.Security.Cryptography.Algorithms.dll
11973 assemblies/System.Security.Cryptography.Encoding.dll
14801 assemblies/System.Security.Cryptography.OpenSsl.dll
9625 assemblies/System.Security.Cryptography.Primitives.dll
92753 assemblies/System.Security.Cryptography.X509Certificates.dll
52334 assemblies/System.Text.RegularExpressions.dll
14374 assemblies/System.Threading.Channels.dll
643953 assemblies/System.Private.CoreLib.dll
74522 assemblies/Java.Interop.dll
18638 assemblies/Mono.Android.Export.dll
180274 assemblies/Mono.Android.dll
18040 lib/arm64-v8a/libxamarin-app.so
250592 lib/arm64-v8a/libmonodroid.so
776216 lib/arm64-v8a/libSystem.IO.Compression.Native.so
71776 lib/arm64-v8a/libSystem.Native.so
100464 lib/arm64-v8a/libSystem.Security.Cryptography.Native.OpenSsl.so
17498904 lib/arm64-v8a/libmonosgen-2.0.so
66544 lib/arm64-v8a/libxa-internal-api.so
191408 lib/arm64-v8a/libxamarin-debug-app-helper.so
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 64 assemblies/System.Runtime.CompilerServices.Unsafe.dll
- 72 assemblies/Microsoft.Win32.Primitives.dll
- 126 assemblies/Mono.Android.Export.dll
- 134 assemblies/UnnamedProject.dll
- 312 assemblies/System.Runtime.Serialization.Primitives.dll
- 385 assemblies/System.Runtime.InteropServices.RuntimeInformation.dll
- 473 assemblies/Java.Interop.dll
- 1,182 assemblies/System.Net.Quic.dll
- 1,325 assemblies/System.Net.NetworkInformation.dll
- 1,343 assemblies/System.Runtime.Numerics.dll
- 1,401 assemblies/Mono.Android.dll
- 1,404 assemblies/System.ComponentModel.Primitives.dll
- 1,596 assemblies/System.IO.Compression.Brotli.dll
- 1,747 assemblies/System.Linq.dll
- 1,964 assemblies/System.Security.Cryptography.Primitives.dll
- 1,982 assemblies/System.Threading.Channels.dll
- 2,030 assemblies/System.Private.Uri.dll
- 2,242 assemblies/System.Private.Xml.Linq.dll
- 2,309 assemblies/System.ObjectModel.dll
- 2,483 assemblies/System.Collections.NonGeneric.dll
- 2,521 assemblies/System.Formats.Asn1.dll
- 2,557 assemblies/System.Security.Cryptography.Encoding.dll
- 3,073 assemblies/System.Security.Cryptography.OpenSsl.dll
- 3,281 assemblies/System.Net.Primitives.dll
- 3,374 assemblies/System.Text.RegularExpressions.dll
- 3,433 assemblies/System.Collections.dll
- 3,732 assemblies/System.IO.FileSystem.dll
- 3,789 assemblies/System.IO.Compression.dll
- 3,792 assemblies/System.Collections.Concurrent.dll
- 3,796 assemblies/System.Console.dll
- 4,499 assemblies/System.Net.NameResolution.dll
- 4,508 assemblies/System.Runtime.Serialization.Formatters.dll
- 6,560 assemblies/System.Security.Cryptography.Algorithms.dll
- 8,696 assemblies/System.Security.Cryptography.X509Certificates.dll
- 10,435 assemblies/System.Net.Sockets.dll
- 16,661 assemblies/System.Net.Security.dll
- 22,090 assemblies/System.Linq.Expressions.dll
- 27,159 assemblies/System.Net.Http.dll
- 29,064 assemblies/System.Diagnostics.DiagnosticSource.dll *1
- 53,988 assemblies/System.Private.Xml.dll
- 176,050 assemblies/System.Private.CoreLib.dll
Summary:
apk1: 9470449 bin\TestDebug\temp-current\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
apk2: 9052603 .\bin\TestDebug\temp\BuildReleaseArm64False-net5\bin\Release\UnnamedProject.UnnamedProject.apk
- 417,632 Assemblies -15.98% (of 2,613,075)
- 417,846 Package size difference -4.41% (of 9,470,449)

@radekdoulik

Copy link
Copy Markdown
MemberAuthor

@rolfbjarne do you set these feature switches for iOS as well?

Remove `System.Diagnostics.DiagnosticSource.dll` from the list, as it is
now linked away as it should be.

@jonathanpeppersjonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I restarted the MBuild device tests.

The CheckIncludedAssemblies test that is failing because of Mono.Android.Export.dll happens on master, so it is unrelated.

@radekdoulik
radekdoulik merged commit d22f04e into dotnet:masterDec 1, 2020
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
rolfbjarne added a commit to dotnet/macios that referenced this pull request Dec 10, 2020
Set all current feature switches, except for InvariantGlobalization, to
defaults which trim the features.
Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
Ref: dotnet/android#5337
This drops the hello world app size from 28.6 MB to 23.5 MB. Full report:
https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radekdoulik@grendello@dellis1972@jonathanpeppers