Esempio n. 1
0
        public Dictionary <string, long> MeasureMemory(Dictionary <string, ISerializer> serializers, int modelsCount)
        {
            var model = DataPreparer.GenerateModel(1, modelsCount);
            var res   = new Dictionary <string, long>();

            foreach (var serializer in serializers)
            {
                var payload = serializer.Value.Serialize <Model>(model);
                res[serializer.Key] = payload.Length;
            }
            return(res);
        }
Esempio n. 2
0
        public static void Test(IDictionary <string, ISerializer> serializers)
        {
            foreach (var serializer in serializers)
            {
                var model = DataPreparer.GenerateModel(1, 10);

                var s            = serializer.Value;
                var data         = s.Serialize <Model>(model);
                var deserialized = s.Deserialize <Model>(data);
                model.Compare(deserialized);
            }
        }