Browse Source

ASP.NET Tiered PGO (#6011)

Use Tiered Jit to generate Profile Guided Optimization data for next tier of Jitting.

Mark as Stripped as is currently non-standard (currently off by default)
Ben Adams 4 years ago
parent
commit
e9eb60bc8f

+ 19 - 0
frameworks/CSharp/aspnetcore/aspcore-pgo-pg-up.dockerfile

@@ -0,0 +1,19 @@
+FROM mcr.microsoft.com/dotnet/core/sdk:5.0 AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out /p:IsDatabase=true
+
+FROM mcr.microsoft.com/dotnet/core/aspnet:5.0 AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+WORKDIR /app
+COPY --from=build /app/out ./
+COPY PlatformBenchmarks/appsettings.postgresql.updates.json ./appsettings.json
+
+# Switch off AoT code in libs to allow for greater instrumentation
+ENV COMPlus_ReadyToRun 0
+# Move methods with loops to Tier0 rather than Tier1 by default for greater instrumentation
+ENV COMPlus_TC_QuickJitForLoops 1
+# Switch on Profile Guided Optimization instrumentation at Tier0 
+ENV COMPlus_TieredPGO 1
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 19 - 0
frameworks/CSharp/aspnetcore/aspcore-pgo-pg.dockerfile

@@ -0,0 +1,19 @@
+FROM mcr.microsoft.com/dotnet/core/sdk:5.0 AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out /p:IsDatabase=true
+
+FROM mcr.microsoft.com/dotnet/core/aspnet:5.0 AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+WORKDIR /app
+COPY --from=build /app/out ./
+COPY PlatformBenchmarks/appsettings.postgresql.json ./appsettings.json
+
+# Switch off AoT code in libs to allow for greater instrumentation
+ENV COMPlus_ReadyToRun 0
+# Move methods with loops to Tier0 rather than Tier1 by default for greater instrumentation
+ENV COMPlus_TC_QuickJitForLoops 1
+# Switch on Profile Guided Optimization instrumentation at Tier0 
+ENV COMPlus_TieredPGO 1
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 19 - 0
frameworks/CSharp/aspnetcore/aspcore-pgo.dockerfile

@@ -0,0 +1,19 @@
+FROM mcr.microsoft.com/dotnet/core/sdk:5.0 AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM mcr.microsoft.com/dotnet/core/aspnet:5.0 AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+WORKDIR /app
+COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.json ./appsettings.json
+
+# Switch off AoT code in libs to allow for greater instrumentation
+ENV COMPlus_ReadyToRun 0
+# Move methods with loops to Tier0 rather than Tier1 by default for greater instrumentation
+ENV COMPlus_TC_QuickJitForLoops 1
+# Switch on Profile Guided Optimization instrumentation at Tier0 
+ENV COMPlus_TieredPGO 1
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 58 - 0
frameworks/CSharp/aspnetcore/benchmark_config.json

@@ -39,6 +39,25 @@
       "notes": "",
       "notes": "",
       "versus": "aspcore"
       "versus": "aspcore"
     },
     },
+    "pgo": {
+      "plaintext_url": "/plaintext",
+      "json_url": "/json",
+      "port": 8080,
+      "approach": "Stripped",
+      "classification": "Platform",
+      "database": "None",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ASP.NET Core, Profile Guided Optimization",
+      "notes": "",
+      "versus": "aspcore"
+    },
     "ado-pg": {
     "ado-pg": {
       "fortune_url": "/fortunes",
       "fortune_url": "/fortunes",
       "db_url": "/db",
       "db_url": "/db",
@@ -78,6 +97,45 @@
       "notes": "",
       "notes": "",
       "versus": "aspcore-ado-pg-up"
       "versus": "aspcore-ado-pg-up"
     },
     },
+    "pgo-pg": {
+      "fortune_url": "/fortunes",
+      "db_url": "/db",
+      "query_url": "/queries/",
+      "cached_query_url": "/cached-worlds/",
+      "port": 8080,
+      "approach": "Stripped",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ASP.NET Core, Profile Guided Optimization",
+      "notes": "",
+      "versus": "aspcore-ado-pg"
+    },
+    "pgo-pg-up": {
+      "update_url": "/updates/",
+      "port": 8080,
+      "approach": "Stripped",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ASP.NET Core, Profile Guided Optimization",
+      "notes": "",
+      "versus": "aspcore-ado-pg-up"
+    },
     "rhtx-pg": {
     "rhtx-pg": {
       "fortune_url": "/fortunes",
       "fortune_url": "/fortunes",
       "db_url": "/db",
       "db_url": "/db",