Ejemplo n.º 1
0
        public void TimesProtoSerealize([Values(5000000)] int count)
        {
            var barInst = new TimesFoo()
            {
                field    = 1244,
                Prop     = "kdjshosudh",
                a        = 1.2f,
                _propBar = new Bar()
                {
                    field    = 12343,
                    Property = "asdsafas",
                    Struct   = new Foo()
                    {
                        field    = 02342,
                        Property = "sds",
                    }
                }
            };

            for (int i = 0; i < count; i++)
            {
                using (var s = new MemoryStream())
                {
                    Serializer.Serialize(s, barInst);
                    var b = s.GetBuffer();
                }
            }
        }
Ejemplo n.º 2
0
        public void TimesExpressionSerealize([Values(5000000)] int count)
        {
            var barInst = new TimesFoo()
            {
                field    = 1244,
                Prop     = "kdjshosudh",
                a        = 1.2f,
                _propBar = new Bar()
                {
                    field    = 12343,
                    Property = "asdsafas",
                    Struct   = new Foo()
                    {
                        field    = 02342,
                        Property = "sds",
                    }
                }
            };

            for (int i = 0; i < count; i++)
            {
                exprManager.Serialize(barInst);
            }
        }