From 5288ded0c735eacbf6e650b535c7bbe84a8d38a8 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Wed, 12 Jan 2022 00:20:13 +0700 Subject: [PATCH] Fix SerializeStructBenchmark, Serializer not initialized --- src/Hyperion.Benchmarks/Program.cs | 12 ++++++++++-- src/Hyperion.Benchmarks/SerializeStructsBenchmark.cs | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Hyperion.Benchmarks/Program.cs b/src/Hyperion.Benchmarks/Program.cs index 41a15b23..acec8c5d 100644 --- a/src/Hyperion.Benchmarks/Program.cs +++ b/src/Hyperion.Benchmarks/Program.cs @@ -8,8 +8,16 @@ class Program { static void Main(string[] args) { - var benchmark = BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()); - benchmark.RunAll(); + var benchmark = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly); + + if (args.Length == 0) + { + benchmark.RunAll(); + } + else + { + benchmark.Run(args); + } } } } diff --git a/src/Hyperion.Benchmarks/SerializeStructsBenchmark.cs b/src/Hyperion.Benchmarks/SerializeStructsBenchmark.cs index 63fbd47d..2f625bdb 100644 --- a/src/Hyperion.Benchmarks/SerializeStructsBenchmark.cs +++ b/src/Hyperion.Benchmarks/SerializeStructsBenchmark.cs @@ -21,6 +21,7 @@ public class SerializeStructsBenchmark : HyperionBenchmark protected override void Init() { + base.Init(); standardValue = new StandardStruct(1, "John", "Doe", isLoggedIn: false); blittableValue = new BlittableStruct(59, 92); testEnum = TestEnum.HatesAll;