View ActorPathFormatter.cs
internal static class ActorPathResolverGetFormatterHelper
{
// If type is concrete type, use type-formatter map
static readonly Dictionary<Type, object> FormatterMap = new Dictionary<Type, object>()
{
{typeof(ActorPath), new ActorPathFormatter<ActorPath>()},
{typeof(ChildActorPath), new ActorPathFormatter<ChildActorPath>()},
{typeof(RootActorPath), new ActorPathFormatter<RootActorPath>()}
};
View UnitTestLoader.cs
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
}
View SampleGroup.cs
// 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;
View ToYieldInstruction.cs
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))
View UnityDebugLogger.cs
using Grpc.Core.Logging;
using System;
namespace MagicOnion
{
public class UnityDebugLogger : ILogger
{
readonly Type forType;
readonly string forTypeString;
View flatmaplike.cs
using System;
using System.Collections.Generic;
class Base { }
class A : Base { }
class B : Base { }
class Program
{
View WirePerfTestResult.md

Test LargeStructTest

Running cold

ZeroFormatter
   Serialize                      45 ms
   Deserialize                    40 ms
   Size                           32 bytes
   Total                          85 ms
View code.cs
private void SerializeZeroFormatter()
{
var bytes = ZeroFormatter.ZeroFormatterSerializer.Serialize(Value);
RunTest("ZeroFormatter", () =>
{
ZeroFormatter.ZeroFormatterSerializer.Serialize(Value);
}, () =>
{
ZeroFormatter.ZeroFormatterSerializer.Deserialize<T>(bytes);
}, bytes.Length);
View ZeroFormatter-Wire.txt
Warming-up
ZeroFormatter
ZeroFormatter
ZeroFormatter
ZeroFormatter
ZeroFormatter
ZeroFormatter
Wire
Wire
View result.txt
Warming-up
ZeroFormatter
ZeroFormatter
protobuf-net
protobuf-net
MsgPack-CLI
MsgPack-CLI
JSON.NET
JSON.NET