diff options
author | Andrew Arnott <andrewarnott@live.com> | 2022-08-02 17:32:40 +0300 |
---|---|---|
committer | Andrew Arnott <andrewarnott@live.com> | 2022-08-02 17:32:40 +0300 |
commit | 37e2dbc2420e13f5b70f4d38bdb0457dfc191146 (patch) | |
tree | c0fdbb23e4ee7fd36187396e150b803bf894a09f | |
parent | 1092f85b68ceff6667eadf43081097e02adb77c8 (diff) |
Add non-generic serialize/deserialize perf tests
-rw-r--r-- | sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs | 8 | ||||
-rw-r--r-- | sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs index 3c0ef2f2..68af163a 100644 --- a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs +++ b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs @@ -1,4 +1,4 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. extern alias newmsgpack; @@ -61,6 +61,12 @@ namespace PerfBenchmarkDotNet } [Benchmark] + public IntKeySerializerTarget IntKey_NonGeneric() + { + return (IntKeySerializerTarget)newmsgpack.MessagePack.MessagePackSerializer.Deserialize(typeof(IntKeySerializerTarget), intObj); + } + + [Benchmark] public StringKeySerializerTarget StringKey() { return newmsgpack.MessagePack.MessagePackSerializer.Deserialize<StringKeySerializerTarget>(stringKeyObj); diff --git a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs index 0ed114b0..fc9a3a06 100644 --- a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs +++ b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs @@ -1,4 +1,4 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. extern alias newmsgpack; @@ -36,6 +36,12 @@ namespace PerfBenchmarkDotNet } [Benchmark] + public byte[] IntKey_NonGeneric() + { + return newmsgpack.MessagePack.MessagePackSerializer.Serialize(typeof(IntKeySerializerTarget), intData); + } + + [Benchmark] public byte[] StringKey() { return newmsgpack.MessagePack.MessagePackSerializer.Serialize<StringKeySerializerTarget>(stringData); |