C#

Performance Test – Binary serializers Part II

Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers. A little while ago I put together a quick performance test comparing the BCL’s BinaryFormatter with that of Marc Gravell‘s protobuf-net library (.Net implementation of Google’s protocol buffer format). You can read more about my …

Performance Test – Binary serializers Part II Read More »

Performance Test – SortedDictionary vs Dictionary vs Map vs Array

I stumbled upon this interesting question on StackOverflow today, Jon Harrop’s answer mentions a significant overhead in adding and iterating over a SortedDictionary and Map compared to using simple arrays. Thinking about it, this makes sense, the SortedDictionary class sorts its constituent key-value pairs by key, which will naturally incur some performance overhead. F#’s Map …

Performance Test – SortedDictionary vs Dictionary vs Map vs Array Read More »

Nancy self hosting

One of the great thing about Nancy is that you can host it in pretty much everywhere, and that includes inside a console app! The documentations seems to be missing the self-hosting option however, but it’s easy and only takes a minute. First, create a console app and get the Nancy.Hosting.Self package from NuGet: Then …

Nancy self hosting Read More »

Extension Methods – Serialize/Deserialize as Json/XML

Cranked these out last night, hope you find it useful too 1: public static class SerializationExtensions 2: { 3: private static readonly ConcurrentDictionary<Type, XmlSerializer> XmlSerializers = 4: new ConcurrentDictionary<Type, XmlSerializer>(); 5: 6: private static readonly ConcurrentDictionary<Type, DataContractJsonSerializer> JsonSerializers = 7: new ConcurrentDictionary<Type, DataContractJsonSerializer>(); 8: 9: private static readonly JavaScriptSerializer JavaScriptSerializer = new JavaScriptSerializer(); 10: 11: …

Extension Methods – Serialize/Deserialize as Json/XML Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close