Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
VS 2022 17.5.4
Description
After converting our code from Classic Xamarin to .NET Android we noticed that calling
System.TimeZoneInfo.GetSystemTimeZones() is unacceptable slow the first time. The second time it's fast, probably uses some internal caching.
E.g in fully optimized release mode:
Xamarin: 68ms
.NET Android (.net7.0): 670ms Almost 10 times slower!
In Debug mode the call can even take 4500ms the first time!
This is a problem since we do a lot of timezone conversion also directly after startup and you really notice this hickup from the first call.
Tested it on real device and Emulator Android 13.
Steps to Reproduce
Create a .NET Android app and call:
System.TimeZoneInfo.GetSystemTimeZones()
Notice how slow it is the first time.
Did you find any workaround?
No
Relevant log output
No response