Skip to content

Commit ee4acd1

Browse files
committed
Add performance startup tests with PublishAot configuration
1 parent a77ffa3 commit ee4acd1

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<RootNamespace>perftest</RootNamespace>
9+
10+
<PublishAot>true</PublishAot>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\..\UnitsNet\UnitsNet.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
using UnitsNet;
2+
using UnitsNet.Units;
3+
4+
Console.WriteLine(Power.From(5, PowerUnit.Watt));
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# shellcheck disable=SC2155
3+
declare -r dirname=$(dirname -- "$0")
4+
5+
pushd "$dirname" || exit
6+
dotnet publish
7+
dotnet timeit "$dirname/timeit.json"
8+
popd || exit
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"warmUpCount": 10,
3+
"count": 20,
4+
"scenarios": [{ "name": "Default" }],
5+
"processName": "../../Artifacts/PerfTest_Startup_Aot/net9.0/win-x64/publish/PerfTest_Startup_Aot.exe",
6+
"workingDirectory": "$(CWD)/",
7+
"processTimeout": 15
8+
}

UnitsNet.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfTests", "PerfTests", "{
7070
EndProject
7171
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfTest_Startup_v4_72_0", "PerfTests\PerfTest_Startup_v4_72_0\PerfTest_Startup_v4_72_0.csproj", "{7131F7CC-BD7F-44EB-AD50-AE80CE38F28E}"
7272
EndProject
73+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfTest_Startup_Aot", "PerfTests\PerfTest_Startup_Aot\PerfTest_Startup_Aot.csproj", "{0222DB9C-52B5-4766-A068-617A44B7E3EB}"
74+
EndProject
7375
Global
7476
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7577
Debug|Any CPU = Debug|Any CPU
@@ -120,6 +122,10 @@ Global
120122
{7131F7CC-BD7F-44EB-AD50-AE80CE38F28E}.Debug|Any CPU.Build.0 = Debug|Any CPU
121123
{7131F7CC-BD7F-44EB-AD50-AE80CE38F28E}.Release|Any CPU.ActiveCfg = Release|Any CPU
122124
{7131F7CC-BD7F-44EB-AD50-AE80CE38F28E}.Release|Any CPU.Build.0 = Release|Any CPU
125+
{0222DB9C-52B5-4766-A068-617A44B7E3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
126+
{0222DB9C-52B5-4766-A068-617A44B7E3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
127+
{0222DB9C-52B5-4766-A068-617A44B7E3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
128+
{0222DB9C-52B5-4766-A068-617A44B7E3EB}.Release|Any CPU.Build.0 = Release|Any CPU
123129
EndGlobalSection
124130
GlobalSection(SolutionProperties) = preSolution
125131
HideSolutionNode = FALSE
@@ -132,5 +138,6 @@ Global
132138
{BFF3DD22-0F58-4E79-86CD-662D1A174224} = {126F0393-A678-4609-9341-7028F1B2BC2B}
133139
{2E68C361-F6FA-49DC-BB0E-85ADE776391E} = {126F0393-A678-4609-9341-7028F1B2BC2B}
134140
{7131F7CC-BD7F-44EB-AD50-AE80CE38F28E} = {126F0393-A678-4609-9341-7028F1B2BC2B}
141+
{0222DB9C-52B5-4766-A068-617A44B7E3EB} = {126F0393-A678-4609-9341-7028F1B2BC2B}
135142
EndGlobalSection
136143
EndGlobal

0 commit comments

Comments
 (0)