static ClassDeserializeBenchmark()
        {
            ProtoInput = new MemoryStream();
            ProtoBuf.Serializer.Serialize(ProtoInput, IntClass.Create());

            HyperionInput   = new MemoryStream();
            HyperionSession = HyperionSerializer.GetDeserializerSession();
            HyperionSerializer.Serialize(IntClass.Create(), HyperionInput);

            // Hagar
            var services = new ServiceCollection()
                           .AddHagar(hagar => hagar.AddAssembly(typeof(Program).Assembly))
                           .BuildServiceProvider();

            HagarSerializer = services.GetRequiredService <Serializer <IntClass> >();
            var bytes = new byte[1000];

            Session = services.GetRequiredService <SerializerSessionPool>().GetSession();
            var writer = new SingleSegmentBuffer(bytes).CreateWriter(Session);

            //HagarSerializer.Serialize(ref writer, IntClass.Create());
            writer.WriteStartObject(0, typeof(IntClass), typeof(IntClass));
            Generated.Serialize(ref writer, IntClass.Create());
            writer.WriteEndObject();
            HagarInput = bytes;

            Utf8JsonInput = Utf8JsonNS.JsonSerializer.Serialize(IntClass.Create(), Utf8JsonResolver);

            var stream = new MemoryStream();

            using (var jsonWriter = new System.Text.Json.Utf8JsonWriter(stream))
            {
                System.Text.Json.JsonSerializer.Serialize <IntClass>(jsonWriter, IntClass.Create());
            }

            SystemTextJsonInput = stream.ToArray();
        }
        static StructDeserializeBenchmark()
        {
            ProtoInput = new MemoryStream();
            ProtoBuf.Serializer.Serialize(ProtoInput, IntStruct.Create());

            HyperionInput = new MemoryStream();
            HyperionSerializer.Serialize(IntStruct.Create(), HyperionInput);

            // Hagar
            var services = new ServiceCollection()
                           .AddHagar(hagar => hagar.AddAssembly(typeof(Program).Assembly))
                           .BuildServiceProvider();

            HagarSerializer = services.GetRequiredService <ValueSerializer <IntStruct> >();
            Session         = services.GetRequiredService <SerializerSessionPool>().GetSession();
            var       bytes     = new byte[1000];
            var       writer    = new SingleSegmentBuffer(bytes).CreateWriter(Session);
            IntStruct intStruct = IntStruct.Create();

            HagarSerializer.Serialize(ref intStruct, ref writer);
            HagarHandCraftedSerializer = new HagarGen_Serializer_IntStruct_1843466();
            HagarInput = bytes;

            HyperionSession = HyperionSerializer.GetDeserializerSession();

            Utf8JsonInput = Utf8JsonNS.JsonSerializer.Serialize(IntStruct.Create(), Utf8JsonResolver);

            var stream = new MemoryStream();

            using (var jsonWriter = new System.Text.Json.Utf8JsonWriter(stream))
            {
                System.Text.Json.JsonSerializer.Serialize <IntStruct>(jsonWriter, IntStruct.Create());
            }

            SystemTextJsonInput = stream.ToArray();
        }