aboutsummaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-10-20 12:31:59 +0200
committerBond_009 <bond.009@outlook.com>2019-11-01 17:52:29 +0100
commit593107e190856b7059f9e32f7dcb1343ca057db7 (patch)
tree95daf84e195c5ae3282b17f7c19a6ac138e4c2a3 /benches
parentb6627af65f690754e14902144237e2f8866ca193 (diff)
Multiplication is faster than bit shifting
Diffstat (limited to 'benches')
-rw-r--r--benches/Jellyfin.Common.Benches/HexDecodeBenches.cs5
-rw-r--r--benches/Jellyfin.Common.Benches/Program.cs2
2 files changed, 5 insertions, 2 deletions
diff --git a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
index 2efe5273f..5cd47202c 100644
--- a/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
+++ b/benches/Jellyfin.Common.Benches/HexDecodeBenches.cs
@@ -9,7 +9,7 @@ namespace Jellyfin.Common.Benches
[MemoryDiagnoser]
public class HexDecodeBenches
{
- [Params(0, 10, 100, 1000, 10000, 1000000)]
+ [Params(/*0,*/ 10, 100, 1000, 10000, 1000000)]
public int N { get; set; }
private string data;
@@ -40,6 +40,9 @@ namespace Jellyfin.Common.Benches
public byte[] Decode() => Hex.Decode(data);
[Benchmark]
+ public byte[] Decode2() => Hex.Decode2(data);
+
+ //[Benchmark]
public byte[] DecodeSubString() => DecodeSubString(data);
}
}
diff --git a/benches/Jellyfin.Common.Benches/Program.cs b/benches/Jellyfin.Common.Benches/Program.cs
index b218b0dc1..e7d51c1b5 100644
--- a/benches/Jellyfin.Common.Benches/Program.cs
+++ b/benches/Jellyfin.Common.Benches/Program.cs
@@ -7,7 +7,7 @@ namespace Jellyfin.Common.Benches
{
public static void Main(string[] args)
{
- _ = BenchmarkRunner.Run<HexEncodeBenches>();
+ //_ = BenchmarkRunner.Run<HexEncodeBenches>();
_ = BenchmarkRunner.Run<HexDecodeBenches>();
}
}