Skip to content

Commit

Permalink
[profiled-aot] update profile for .NET 8 GA (#8428)
Browse files Browse the repository at this point in the history
First, I had to update the URL we test, because it was down:

https://httpstat.us/200

Instead, I used:

https://httpbin.org/status/200

Next, after reviewing the latest methods in the profile, I noticed a
lot of timezone logic was completely removed. This might be related
to different cookies returns from the new URL, not sure.

I added a `DateTime.Now` call to `CommonMethods.cs`, to ensure the
timezone logic is in the AOT profile.

Testing a `dotnet new android` app on a Pixel 5, an average of 10 runs
of the "displayed time`:

	Average(ms): 179.1
	Std Err(ms): 2.53179778023443
	Std Dev(ms): 8.00624756049924
  • Loading branch information
jonathanpeppers authored Oct 17, 2023
1 parent b1f2cd8 commit a82a578
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 147 deletions.
6 changes: 5 additions & 1 deletion src/profiled-aot/CommonMethods.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This class represents common code paths we always want to AOT

// DateTime.Now
// string interpolation & split
// int.Parse(), int.ToString()
// Culture-aware string comparisons
Expand All @@ -15,8 +16,11 @@ static class CommonMethods
// Returns '200 OK' if the caller wants to set that on the UI
public static async Task<string> Invoke()
{
var url = $"https://httpstat.us/{200}";
// NOTE: alternate web services if one of these is down
//var url = $"https://httpstat.us/{200}";
var url = $"https://httpbin.org/status/{200}";

var now = DateTime.Now;
var foo = "foo";
foo.StartsWith("f");
foo.Contains("o");
Expand Down
Binary file modified src/profiled-aot/dotnet.aotprofile
Binary file not shown.
Loading

0 comments on commit a82a578

Please sign in to comment.