ZeroFormatter
Serialize 45 ms
Deserialize 40 ms
Size 32 bytes
Total 85 ms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install-Package MsgPack.Cli | |
// Install-Package Newtonsoft.Json | |
// Install-Package protobuf-net | |
// Install-Package ZeroFormatter | |
using MsgPack.Serialization; | |
using Newtonsoft.Json; | |
using ProtoBuf; | |
using System; | |
using System.Collections.Generic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warming-up | |
ZeroFormatter | |
ZeroFormatter | |
protobuf-net | |
protobuf-net | |
MsgPack-CLI | |
MsgPack-CLI | |
JSON.NET | |
JSON.NET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warming-up | |
ZeroFormatter | |
ZeroFormatter | |
ZeroFormatter | |
ZeroFormatter | |
ZeroFormatter | |
ZeroFormatter | |
Wire | |
Wire |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SerializeZeroFormatter() | |
{ | |
var bytes = ZeroFormatter.ZeroFormatterSerializer.Serialize(Value); | |
RunTest("ZeroFormatter", () => | |
{ | |
ZeroFormatter.ZeroFormatterSerializer.Serialize(Value); | |
}, () => | |
{ | |
ZeroFormatter.ZeroFormatterSerializer.Deserialize<T>(bytes); | |
}, bytes.Length); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
class Base { } | |
class A : Base { } | |
class B : Base { } | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Grpc.Core.Logging; | |
using System; | |
namespace MagicOnion | |
{ | |
public class UnityDebugLogger : ILogger | |
{ | |
readonly Type forType; | |
readonly string forTypeString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Test() | |
{ | |
Observable.ReturnUnit() | |
.SelectMany(_ => Observable.FromCoroutine(x => NestedCoroutine(x))) | |
.Subscribe(_ => Debug.Log("Very Good:)")); | |
} | |
IEnumerator NestedCoroutine(CancellationToken cancel) | |
{ | |
yield return Observable.Timer(System.TimeSpan.FromSeconds(1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make unit test on plain C# class | |
public class SampleGroup | |
{ | |
// all public methods are automatically registered in test group | |
public void SumTest() | |
{ | |
var x = int.Parse("100"); | |
var y = int.Parse("200"); | |
// using RuntimeUnitTestToolkit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class UnitTestLoader | |
{ | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | |
public static void Register() | |
{ | |
// setup created test class to RegisterAllMethods<T> | |
UnitTest.RegisterAllMethods<SampleGroup>(); | |
// and add other classes | |
} |