Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@live.com>2022-08-02 17:45:46 +0300
committerGitHub <noreply@github.com>2022-08-02 17:45:46 +0300
commit10955cc19e09600aa935cf6eb99933bfabbc301b (patch)
tree676a8b7c34a15acc89da46a35c6e87be85a26d36
parent541ad7c6395b9a74629af7277698e783ceeb3adc (diff)
parent37e2dbc2420e13f5b70f4d38bdb0457dfc191146 (diff)
Merge pull request #1478 from AArnott/nongenericperftests
Add non-generic serialize/deserialize perf tests
-rw-r--r--sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs8
-rw-r--r--sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs8
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);