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 »

Performance Test – JSON serializers Part II

Note: Don’t forget to check out Benchmarks page to see the latest round up of binary and JSON serializers. Fol­low on from my pre­vi­ous test which showed that the ServiceStack.Text JSON seri­al­izer was the top dog in town, I came across a lit­tle library called fastJ­son on code­plex so nat­u­rally I had to test it …

Performance Test – JSON serializers Part II Read More »

The cost of throwing exceptions

After reading Ayende‘s post today, it got me thinking, just exactly what’s the cost of a try/catch block and more importantly what’s the cost of throwing exceptions. Like Ken Egozi mentioned in the comments, I too believe the test was unfair as the try/catch block was applied to the top level code as opposed to …

The cost of throwing exceptions Read More »

Integrating Nancy with protobuf-net

Over the last couple of days I’ve been playing around with Nancy, one of a number of micro web frameworks now available for the .Net platform. You can read more about Nancy on their github readme page but in short it’s an ultra lightweight, easily extensible framework that lets you run a HTTP web server …

Integrating Nancy with protobuf-net Read More »

Performance Test – BinaryFormatter vs Protobuf-Net

Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers. When working with the BinaryFormatter class frequently, one of the things you notice is that it is really damn inefficient… both in terms of speed as well as the payload (the size of the serialized …

Performance Test – BinaryFormatter vs Protobuf-Net Read More »

Performance Test – JSON serializers

NOTE: For an updated set of benchmarks, see the Benchmarks page. For those of you who have worked with JSON data in .Net you should be familiar with the DataContractJsonSerializer class and the JavaScriptSerializer class already. Both allow you to serialize/deserialize an object to and from a piece of string in JSON format, though there …

Performance Test – JSON serializers 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