Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit d845ef1

Browse files
authored
JitBench scenarios fix for 2.1 branch (#17317)
* JitBench scenarios fix (#17154) * each web app should use a separate directory to avoid conflicts + dead code removal * update the framework package version to get scenarios benchmarks working * use the correct version for 2.1 branch
1 parent 3077484 commit d845ef1

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<!-- Scenario tests install this version of Microsoft.NetCore.App, then patch coreclr binaries via xcopy. At the moment it is
4646
updated manually whenever breaking changes require it to move forward, but it would be nice if we could update it automatically
4747
as we do with many of the package versions above -->
48-
<BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview2-26131-06</BaselineMicrosoftNetCoreAppPackageVersion>
48+
<BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview2-26326-03</BaselineMicrosoftNetCoreAppPackageVersion>
4949
</PropertyGroup>
5050

5151
<!-- Package versions used as toolsets -->

tests/src/performance/Scenario/JitBench/Benchmarks/WebAppBenchmarks.cs

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ namespace JitBench
99
{
1010
class MusicStoreBenchmark : WebAppBenchmark
1111
{
12-
public MusicStoreBenchmark() : base("MusicStore") { }
12+
public MusicStoreBenchmark() : base("MusicStore", "MusicStore.dll") { }
1313

14-
protected override string ExecutableName => "MusicStore.dll";
14+
protected override string GetJitBenchRepoRootDir(string outputDir)
15+
{
16+
return Path.Combine(outputDir, "K");
17+
}
1518

1619
protected override string GetWebAppSrcDirectory(string outputDir)
1720
{
@@ -21,9 +24,12 @@ protected override string GetWebAppSrcDirectory(string outputDir)
2124

2225
class AllReadyBenchmark : WebAppBenchmark
2326
{
24-
public AllReadyBenchmark() : base("AllReady") { }
27+
public AllReadyBenchmark() : base("AllReady", "AllReady.dll") { }
2528

26-
protected override string ExecutableName => "AllReady.dll";
29+
protected override string GetJitBenchRepoRootDir(string outputDir)
30+
{
31+
return Path.Combine(outputDir, "J");
32+
}
2733

2834
protected override string GetWebAppSrcDirectory(string outputDir)
2935
{
@@ -35,13 +41,11 @@ abstract class WebAppBenchmark : Benchmark
3541
{
3642
private static readonly HashSet<int> DefaultExitCodes = new HashSet<int>(new[] { 0 });
3743

38-
public WebAppBenchmark(string name) : base(name)
44+
public WebAppBenchmark(string name, string executableName) : base(name)
3945
{
40-
ExePath = ExecutableName;
46+
ExePath = executableName;
4147
}
4248

43-
protected abstract string ExecutableName { get; }
44-
4549
public override async Task Setup(DotNetInstallation dotNetInstall, string outputDir, bool useExistingSetup, ITestOutputHelper output)
4650
{
4751
if(!useExistingSetup)
@@ -53,7 +57,7 @@ public override async Task Setup(DotNetInstallation dotNetInstall, string output
5357
await Publish(dotNetInstall, outputDir, setupSection);
5458
}
5559
}
56-
string webAppSrcDirectory = GetWebAppSrcDirectory(outputDir);
60+
5761
string tfm = DotNetSetup.GetTargetFrameworkMonikerForFrameworkVersion(dotNetInstall.FrameworkVersion);
5862
WorkingDirPath = GetWebAppPublishDirectory(dotNetInstall, outputDir, tfm);
5963
EnvironmentVariables.Add("DOTNET_SHARED_STORE", GetWebAppStoreDir(outputDir));
@@ -78,7 +82,7 @@ async Task ExecuteGitCommand(string arguments, ITestOutputHelper output, string
7882
throw new Exception($"git {arguments} has failed, the exit code was {exitCode}");
7983
}
8084

81-
private static async Task CreateStore(DotNetInstallation dotNetInstall, string outputDir, ITestOutputHelper output)
85+
private async Task CreateStore(DotNetInstallation dotNetInstall, string outputDir, ITestOutputHelper output)
8286
{
8387
string tfm = DotNetSetup.GetTargetFrameworkMonikerForFrameworkVersion(dotNetInstall.FrameworkVersion);
8488
string rid = $"win7-{dotNetInstall.Architecture}";
@@ -228,10 +232,7 @@ public override bool TryGetBenchviewCustomMetricReporting(Metric originalMetric,
228232
return true;
229233
}
230234

231-
protected static string GetJitBenchRepoRootDir(string outputDir)
232-
{
233-
return Path.Combine(outputDir, "J");
234-
}
235+
protected abstract string GetJitBenchRepoRootDir(string outputDir);
235236

236237
protected abstract string GetWebAppSrcDirectory(string outputDir);
237238

@@ -252,23 +253,16 @@ string GetWebAppPublishDirectory(DotNetInstallation dotNetInstall, string output
252253
return null;
253254
}
254255

255-
static string GetWebAppStoreDir(string outputDir)
256+
string GetWebAppStoreDir(string outputDir)
256257
{
257258
return Path.Combine(GetJitBenchRepoRootDir(outputDir), StoreDirName);
258259
}
259260

260-
string GetLocalJitBenchRepoDirectory()
261-
{
262-
return Environment.GetEnvironmentVariable("MUSICSTORE_PRIVATE_REPO");
263-
}
264-
265261
private const string JitBenchRepoUrl = "https://github.com/aspnet/JitBench";
266262
private const string JitBenchCommitSha1Id = "6bee730486f272d31f23f1033225090511f856f3";
267-
private const string EnvironmentFileName = "JitBenchEnvironment.txt";
268263
private const string StoreDirName = ".store";
269264
private readonly Metric StartupMetric = new Metric("Startup", "ms");
270265
private readonly Metric FirstRequestMetric = new Metric("First Request", "ms");
271266
private readonly Metric MedianResponseMetric = new Metric("Median Response", "ms");
272-
private readonly Metric MeanResponseMetric = new Metric("Mean Response", "ms");
273267
}
274268
}

0 commit comments

Comments
 (0)