<XunitConsoleNetcorePackageVersion>1.0.2-prerelease-00177</XunitConsoleNetcorePackageVersion>
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.4</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
- <CommandLineParserVersion>2.1.1</CommandLineParserVersion>
+ <CommandLineParserVersion>2.2.0</CommandLineParserVersion>
<VCRuntimeVersion>1.2.0</VCRuntimeVersion>
<!-- Scenario tests install this version of Microsoft.NetCore.App, then patch coreclr binaries via xcopy. At the moment it is
updated manually whenever breaking changes require it to move forward, but it would be nice if we could update it automatically
as we do with many of the package versions above -->
- <BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview3-26327-01</BaselineMicrosoftNetCoreAppPackageVersion>
+ <BaselineMicrosoftNetCoreAppPackageVersion>2.1.0-preview3-26416-01</BaselineMicrosoftNetCoreAppPackageVersion>
</PropertyGroup>
<!-- Package versions used as toolsets -->
using System.Threading.Tasks;
using System.Reflection;
using Microsoft.Xunit.Performance.Api;
+using System.Runtime.InteropServices;
namespace JitBench
{
{
public Word2VecBenchmark() : base("Word2Vec") { }
+ public override bool IsArchitectureSupported(Architecture arch)
+ {
+ //Word2Vec uses large amounts of virtual address space which it may or may not exhaust
+ //when running on x86. In the case I investigated there was still a few 100MB free,
+ //but it was sufficiently fragmented that the largest block was less than 32MB which
+ //is what the GC wants for a new LOH segment. The GC behavior here is by-design.
+ //Tiered jitting increases the memory usage (more code) and may cause different
+ //fragmentation patterns - arguably either 'by design' or 'known issue that won't change
+ //unless customers tell us its a problem'. I'm OK telling people not to use tiered jitting
+ //if their app already uses most of the address space on x86, and having an intermitently
+ //failing test in a perf suite won't give us useful info hence x64 only for this one.
+ return arch == Architecture.X64;
+ }
+
protected override string ExecutableName => "Word2VecScenario.dll";
protected override string GetWord2VecNetSrcDirectory(string outputDir)
using System.Diagnostics;
using System.IO;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xunit.Performance.Api;
return new Metric[] { Metric.ElapsedTimeMilliseconds };
}
+ /// <summary>
+ /// Does this benchmark run properly on a given architecture?
+ /// </summary>
+ public virtual bool IsArchitectureSupported(Architecture arch)
+ {
+ return (arch == Architecture.X86 || arch == Architecture.X64);
+ }
+
BenchmarkRunResult[] MeasureIterations(TestRun run, ITestOutputHelper output)
{
List<BenchmarkRunResult> results = new List<BenchmarkRunResult>();
await PrepareDotNet(output);
foreach (Benchmark benchmark in Benchmarks)
{
+ if(!benchmark.IsArchitectureSupported(Architecture))
+ {
+ output.WriteLine("Benchmark " + benchmark.Name + " does not support architecture " + Architecture + ". Skipping setup.");
+ continue;
+ }
await benchmark.Setup(DotNetInstallation, OutputDir, UseExistingSetup, output);
}
}
output.WriteLine("");
foreach (Benchmark benchmark in Benchmarks)
{
+ if (!benchmark.IsArchitectureSupported(Architecture))
+ {
+ output.WriteLine("Benchmark " + benchmark.Name + " does not support architecture " + Architecture + ". Skipping run.");
+ continue;
+ }
BenchmarkRunResults.AddRange(benchmark.Run(this, output));
}
}