Skip to content

Commit

Permalink
fix working folder being wrong in serialization benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Jun 30, 2020
1 parent 6489aa2 commit 1470d4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Benchmarks/DualityBenchmarks/DualityBenchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<OutputPath>$(RootFolder)Build\Output\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion Benchmarks/DualityBenchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Validators;

namespace DualityBenchmarks
{
Expand All @@ -14,7 +15,7 @@ static void Main(string[] args)
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine($"[WARNING] Running with debugger attached, using {nameof(DebugInProcessConfig)} this might affect benchmark results!");
Console.ResetColor();
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig());
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, new DebugInProcessConfig().AddValidator(ExecutionValidator.FailOnError));
}
else {
BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
Expand Down
12 changes: 4 additions & 8 deletions Benchmarks/DualityBenchmarks/SerializerBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using Duality.Tests.Serialization;
using Duality.Serialization;
using BenchmarkDotNet.Attributes;
using Duality;
using Duality.Backend;
using Duality.Launcher;

namespace DualityBenchmarks
Expand All @@ -21,14 +19,12 @@ public class SerializerBenchmarks
private byte[] readData;
private TestObject data;

private DualityLauncher launcher;

[GlobalSetup]
public void Setup()
{
DualityApp.Init(
DualityApp.ExecutionEnvironment.Launcher,
DualityApp.ExecutionContext.Game,
new DefaultAssemblyLoader(),
new LauncherArgs());
this.launcher = new DualityLauncher();

this.results = new TestObject[this.N];
this.data = new TestObject(new Random(0), 5);
Expand All @@ -39,7 +35,7 @@ public void Setup()
[GlobalCleanup]
public void Cleanup()
{
DualityApp.Terminate();
this.launcher.Dispose();
}

[Benchmark]
Expand Down

0 comments on commit 1470d4b

Please sign in to comment.