diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-10-20 00:05:04 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-11-01 17:52:29 +0100 |
| commit | b6627af65f690754e14902144237e2f8866ca193 (patch) | |
| tree | facae05fe3b675368ad263131c3534b1584189d8 /benches | |
| parent | a245f5a0d463e132bcbb3c5871465bdb8bbec0b7 (diff) | |
Make decode even faster
Diffstat (limited to 'benches')
| -rw-r--r-- | benches/Jellyfin.Common.Benches/HexDecodeBenches.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs index 2812755978..2efe5273f7 100644 --- a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs +++ b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs @@ -9,10 +9,13 @@ namespace Jellyfin.Common.Benches [MemoryDiagnoser] public class HexDecodeBenches { - private const int N = 1000000; - private readonly string data; + [Params(0, 10, 100, 1000, 10000, 1000000)] + public int N { get; set; } - public HexDecodeBenches() + private string data; + + [GlobalSetup] + public void GlobalSetup() { var tmp = new byte[N]; new Random(42).NextBytes(tmp); |
