From bcfb45d2efcc1864723b872ab25273a22590544d Mon Sep 17 00:00:00 2001 From: ArchLeaders Date: Tue, 12 Dec 2023 23:40:20 -0800 Subject: [PATCH] Update benchmarks (don't track ms perf) --- Readme.md | 4 ++-- .../Benchmarks/ImmutableSarcBenchmarks.cs | 4 ++-- src/SarcLibrary.Runner/Benchmarks/SarcBenchmarks.cs | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Readme.md b/Readme.md index 3fd12bd..60dffcc 100644 --- a/Readme.md +++ b/Readme.md @@ -27,8 +27,8 @@ sarc.Write(ms); | Read TitleBG (143MB. LE) | 24.27 ms | 140 MB | | Read TitleBG (75MB, BE) | 29.16 ms | 74 MB | | | | | -| Write TitleBG (143MB, LE) | 46.31 ms | 269 MB | -| Write TitleBG (75MB, BE) | 38.11 ms | 259 MB | +| Write TitleBG (143MB, LE) | 12.43 ms | 66 KB | +| Write TitleBG (75MB, BE) | 6.41 ms | 66 KB | | | | | | Read TitleBG (Immutable) (143MB, LE) | 16.61 ns | - | | Read TitleBG (Immutable) (75MB, BE) | 16.27 ns | - | diff --git a/src/SarcLibrary.Runner/Benchmarks/ImmutableSarcBenchmarks.cs b/src/SarcLibrary.Runner/Benchmarks/ImmutableSarcBenchmarks.cs index c35ce0a..acdf053 100644 --- a/src/SarcLibrary.Runner/Benchmarks/ImmutableSarcBenchmarks.cs +++ b/src/SarcLibrary.Runner/Benchmarks/ImmutableSarcBenchmarks.cs @@ -13,13 +13,13 @@ public class ImmutableSarcBenchmarks public void Read_LE() { RevrsReader reader = new(_bufferLE); - ImmutableSarc sarc = new(ref reader); + ImmutableSarc _ = new(ref reader); } [Benchmark] public void Read_BE() { RevrsReader reader = new(_bufferBE); - ImmutableSarc sarc = new(ref reader); + ImmutableSarc _ = new(ref reader); } } diff --git a/src/SarcLibrary.Runner/Benchmarks/SarcBenchmarks.cs b/src/SarcLibrary.Runner/Benchmarks/SarcBenchmarks.cs index 0862f36..1d05fcc 100644 --- a/src/SarcLibrary.Runner/Benchmarks/SarcBenchmarks.cs +++ b/src/SarcLibrary.Runner/Benchmarks/SarcBenchmarks.cs @@ -10,29 +10,30 @@ public class SarcBenchmarks private readonly Sarc _sarcLE = Sarc.FromBinary(File.ReadAllBytes(@"D:\bin\Sarc\TitleBG-LE.pack")); private readonly Sarc _sarcBE = Sarc.FromBinary(File.ReadAllBytes(@"D:\bin\Sarc\TitleBG-BE.pack")); + private readonly MemoryStream _sarcMsLE = new(); + private readonly MemoryStream _sarcMsBE = new(); + [Benchmark] public void Read_LE() { - Sarc sarc = Sarc.FromBinary(_bufferLE); + Sarc _ = Sarc.FromBinary(_bufferLE); } [Benchmark] public void Read_BE() { - Sarc sarc = Sarc.FromBinary(_bufferBE); + Sarc _ = Sarc.FromBinary(_bufferBE); } [Benchmark] public void Write_LE() { - using MemoryStream ms = new(); - _sarcLE.Write(ms); + _sarcLE.Write(_sarcMsLE); } [Benchmark] public void Write_BE() { - using MemoryStream ms = new(); - _sarcBE.Write(ms); + _sarcBE.Write(_sarcMsBE); } }