Code Monkey home page Code Monkey logo

public-broadcasting's People

Contributors

jasonpunyon avatar jgeurts avatar kevin-montrose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

public-broadcasting's Issues

The given key was not present in the dictionary

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at PublicBroadcasting.Impl.Deserializer.IsExactMatch(Type type, TypeDescription description, Dictionary2 backLookup) in Deserializer.cs: line 200
at PublicBroadcasting.Impl.Deserializer.IsExactMatch(Type type, TypeDescription description, Dictionary2 backLookup) in Deserializer.cs: line 231 at PublicBroadcasting.Impl.Deserializer.IsExactMatch(Type type, TypeDescription description, Dictionary2 backLookup) in Deserializer.cs: line 174
at PublicBroadcasting.Impl.Deserializer.DeserializeCore(Stream stream, Type tryMakeType, ref Type type) in Deserializer.cs: line 68
at PublicBroadcasting.Impl.Deserializer.Deserialize(Stream stream) in Deserializer.cs: line 21
at PublicBroadcasting.Serializer.Deserialize(Stream stream) in Serializer.cs: line 765
at PublicBroadcasting.Serializer.Deserialize(Byte[] bytes) in Serializer.cs: line 734

Caching of already Used Types

When serializing 100.000 instances of the same type (with different values) public-broadcasting takes around 12 seconds. Using protobuf directly (with the classes annotated with [ProtoMember] and etc.) the same experiment takes 0.79 seconds. Deserialization follows the same pattern.

It doesn't seem like public-broadcasting is caching the envelopes it is creating and so it is recreating them every time (something that is expensive).

[InvalidOperationException: Unexpected sub-type: System.String]

Not sure if this is publicbroadcasting or protobuf, but this is the stack trace:

[InvalidOperationException: Unexpected sub-type: System.String]
   ProtoBuf.Meta.TypeModel.ThrowUnexpectedSubtype(Type expected, Type actual) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:1335
   proto_3(Object , ProtoWriter ) +47
   ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Write(Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:53
   ProtoBuf.Meta.RuntimeTypeModel.Serialize(Int32 key, Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:760
   ProtoBuf.ProtoWriter.WriteObject(Object value, Int32 key, ProtoWriter writer) in c:\Dev\protobuf-net\protobuf-net\ProtoWriter.cs:46
   proto_5(Object , ProtoWriter ) +96
   ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Write(Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:53
   ProtoBuf.Meta.RuntimeTypeModel.Serialize(Int32 key, Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:760
   ProtoBuf.ProtoWriter.WriteObject(Object value, Int32 key, ProtoWriter writer) in c:\Dev\protobuf-net\protobuf-net\ProtoWriter.cs:46
   proto_1(Object , ProtoWriter ) +564
   ProtoBuf.Serializers.CompiledSerializer.ProtoBuf.Serializers.IProtoSerializer.Write(Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Serializers\CompiledSerializer.cs:53
   ProtoBuf.Meta.RuntimeTypeModel.Serialize(Int32 key, Object value, ProtoWriter dest) in c:\Dev\protobuf-net\protobuf-net\Meta\RuntimeTypeModel.cs:760
   ProtoBuf.Meta.TypeModel.SerializeCore(ProtoWriter writer, Object value) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:186
   ProtoBuf.Meta.TypeModel.Serialize(Stream dest, Object value, SerializationContext context) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:217
   ProtoBuf.Meta.TypeModel.Serialize(Stream dest, Object value) in c:\Dev\protobuf-net\protobuf-net\Meta\TypeModel.cs:201
   PublicBroadcasting.Impl.Envelope.Get(TypeDescription desc, POCOBuilder mapper, Object payload) in c:\Users\kmontrose\Dropbox\PublicBroadcasting\PublicBroadcasting\Impl\Envelope.cs:45
   PublicBroadcasting.Serializer.Serialize(Stream stream, T obj, IncludedMembers members, IncludedVisibility visibility) in c:\Users\kmontrose\Dropbox\PublicBroadcasting\PublicBroadcasting\Serializer.cs:248
   PublicBroadcasting.Serializer.Serialize(T obj, IncludedMembers members, IncludedVisibility visibility) in c:\Users\kmontrose\Dropbox\PublicBroadcasting\PublicBroadcasting\Serializer.cs:119
   PublicBroadcasting.Serializer.Serialize(T obj) in c:\Users\kmontrose\Dropbox\PublicBroadcasting\PublicBroadcasting\Serializer.cs:34

The object I'm trying to serialize looks like:

public class ActionSettings
{
    public string ActionName { get; set; }
    public string ControllerName { get; set; }
    public RouteValueDictionary RouteValues { get; set; }
}

Hope this helps and please let me know if I can provide any other details

ArgumentNullException while deserializing an object

I'll try to work on a reliable reproduction, but in the mean time, this is the stack trace:

[ArgumentNullException: Value cannot be null.
Parameter name: type]
   System.Reflection.Emit.FieldBuilder..ctor(TypeBuilder typeBuilder, String fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes) +10533905
   System.Reflection.Emit.TypeBuilder.DefineFieldNoLock(String fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes) +146
   System.Reflection.Emit.TypeBuilder.DefineField(String fieldName, Type type, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers, FieldAttributes attributes) +98
   System.Reflection.Emit.TypeBuilder.DefineField(String fieldName, Type type, FieldAttributes attributes) +17
   PublicBroadcasting.Impl.ClassTypeDescription.Seal(TypeDescription existing) in c:\Dev\Forks\public-broadcasting\PublicBroadcasting\Impl\Describer.ClassTypeDescription.cs:248
   PublicBroadcasting.Impl.Deserializer.DeserializeCore(Stream stream, Type& type) in c:\Dev\Forks\public-broadcasting\PublicBroadcasting\Impl\Deserializer.cs:65
   PublicBroadcasting.Impl.Deserializer.Deserialize(Stream stream) in c:\Dev\Forks\public-broadcasting\PublicBroadcasting\Impl\Deserializer.cs:19
   PublicBroadcasting.Serializer.Deserialize(Stream stream) in c:\Dev\Forks\public-broadcasting\PublicBroadcasting\Serializer.cs:631
   PublicBroadcasting.Serializer.Deserialize(Byte[] bytes) in c:\Dev\Forks\public-broadcasting\PublicBroadcasting\Serializer.cs:614

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.