Skip to content

Conversation

DamianEdwards
Copy link
Member

Updates the Platform and Minimal TechEmpower benchmarks to the latest Razor Slices release that uses source generators and supports native AOT. Razor Slices doesn't support rendering to IBufferWriter<byte> anymore so had to change ChunkedBufferWriter to ChunkedPipeWriter.

Removed the .net7.0 targets as we don't run those anymore and tweaked the version check condition in .csproj files to be compatible with multi-targeting builds.

Also fixed the launch settings in the Platform project so it runs from VS.

Results after the change are within the usual noise margins, i.e. ~566K - ~630K RPS:

image

db fortunes-platform-baseline fortunes-platform-update
Max CPU Usage (%) 33 33 0.00%
Max Cores usage (%) 1,840 1,846 +0.33%
Max Working Set (MB) 560 574 +2.50%
Build Time (ms) 1,136 1,146 +0.88%
Start Time (ms) 1,806 1,825 +1.05%
Published Size (KB) 424,584 424,584 0.00%
application fortunes-platform-baseline fortunes-platform-update
Max CPU Usage (%) 72 71 -1.39%
Max Cores usage (%) 4,052 3,953 -2.44%
Max Working Set (MB) 226 225 -0.44%
Max Private Memory (MB) 1,105 1,096 -0.81%
Build Time (ms) 11,012 9,099 -17.37%
Start Time (ms) 9,082 9,411 +3.62%
Published Size (KB) 107,395 107,408 +0.01%
Symbols Size (KB) 54 56 +3.70%
.NET Core SDK Version 10.0.100-alpha.1.24615.1 10.0.100-alpha.1.24615.1
Max CPU Usage (%) 71 69 -3.00%
Max Working Set (MB) 238 235 -0.97%
Max GC Heap Size (MB) 101 97 -4.71%
Size of committed memory by the GC (MB) 140 136 -3.10%
Max Number of Gen 0 GCs / sec 36.00 33.00 -8.33%
Max Number of Gen 1 GCs / sec 2.00 2.00 0.00%
Max Number of Gen 2 GCs / sec 2.00 1.00 -50.00%
Max Gen 0 GC Budget (MB) 73 71 -2.74%
Max Time in GC (%) 18.00 7.00 -61.11%
Max Gen 0 Size (B) 7,691,104 1,129,032 -85.32%
Max Gen 1 Size (B) 25,435,552 9,425,704 -62.94%
Max Gen 2 Size (B) 19,904,576 20,596,264 +3.48%
Max LOH Size (B) 192,448 192,448 0.00%
Max POH Size (B) 4,214,568 4,235,168 +0.49%
Max Allocation Rate (B/sec) 1,994,380,112 2,006,939,776 +0.63%
Max GC Heap Fragmentation (%) 5,334% 3,429% -35.71%
# of Assemblies Loaded 93 89 -4.30%
Max Exceptions (#/s) 964 952 -1.24%
Max Lock Contention (#/s) 5,959 6,104 +2.43%
Max ThreadPool Threads Count 66 73 +10.61%
Max ThreadPool Queue Length 68 67 -1.47%
Max ThreadPool Items (#/s) 1,636,624 1,645,142 +0.52%
Max Active Timers 44 44 0.00%
IL Jitted (B) 644,635 647,966 +0.52%
Methods Jitted 7,785 7,863 +1.00%
Load Working Set - P90 (MB) 220 225 +2.27%
Load CPU Usage - P90 (%) 63 65 +3.17%
load fortunes-platform-baseline fortunes-platform-update
Max CPU Usage (%) 25 23 -8.00%
Max Cores usage (%) 1,375 1,277 -7.13%
Max Working Set (MB) 43 43 0.00%
Max Private Memory (MB) 363 363 0.00%
Build Time (ms) 7,973 0
Start Time (ms) 1 1 0.00%
Published Size (KB) 72,308 0
Symbols Size (KB) 0 0
.NET Core SDK Version 8.0.404 0
First Request (ms) 128 151 +17.97%
Requests/sec 620,856 622,143 +0.21%
Requests 9,374,749 9,394,489 +0.21%
Mean latency (ms) 0.84 0.84 -0.31%
Max latency (ms) 6.91 6.87 -0.58%
Bad responses 0 0
Socket errors 0 0
Read throughput (MB/s) 814.72 816.41 +0.21%
Latency 50th (ms) 0.76 0.77 +0.53%
Latency 75th (ms) 1.02 1.02 0.00%
Latency 90th (ms) 1.34 1.34 0.00%
Latency 99th (ms) 2.52 2.43 -3.57%

loggerFactory.AddConsole(o => o.TimestampFormat = "ss.ffff ").SetMinimumLevel(logLevel);
loggerFactory
.AddConsole()
.AddConsoleFormatter<ConsoleFormatter, ConsoleFormatterOptions>(o => o.TimestampFormat = "ss.ffff")
Copy link
Member Author

Choose a reason for hiding this comment

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

This change was done to resolve an obsolete warning.

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.27.0" />
<PackageReference Include="Microsoft.AspNetCore.Grpc.HttpApi" Version="0.1.0-alpha.20121.1" />
<PackageReference Include="Microsoft.AspNetCore.Grpc.HttpApi" Version="0.1.0-alpha.20179.2" />
Copy link
Member Author

Choose a reason for hiding this comment

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

This was done to quiet a NuGet warning about the previous stated version being unresolvable.

<PackageReference Include="Microsoft.Data.SqlClient" Version="$(MicrosoftDataSqlClientVersion90)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(MicrosoftEntityFrameworkCoreSqliteVersion90)" />
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting.IIS" Version="$(MicrosoftAspNetCoreAppPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting.IIS" Version="$(MicrosoftIISTestingVersion90)" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems this was a typo/copy-pasta that was causing a NuGet warning as the versions didn't line up.

</ItemGroup>

<ItemGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '9.0'))">
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net9.0'))">
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes a build error that occurs when building the project without specifying a target framework, e.g. when building from VS 😄

app.MapGet("/fortunes", async (HttpContext context, Db db) => {
var fortunes = await db.LoadFortunesRows();
var template = (RazorSliceHttpResult<List<Fortune>>)createFortunesTemplate(fortunes);
var template = (RazorSliceHttpResult<List<Fortune>>)Fortunes.Create(fortunes);
Copy link
Member Author

Choose a reason for hiding this comment

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

Razor Slices generates these template factory classes now.

using RazorSlices;

namespace PlatformBenchmarks
namespace PlatformBenchmarks;
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to file-scoped namespace declaration on this file.

@DamianEdwards DamianEdwards merged commit 2705be0 into main Dec 17, 2024
1 check passed
@DamianEdwards DamianEdwards deleted the damianedwards/razorslicesupdate branch December 17, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants