Load balancing is a popular technique when you need to be able to serve thousands and more concurrent requests in a reliable manner. Load balancers distribute incoming network traffic across a group of backend servers (a.k.a. server pool or server farm) to increase throughput. Although many people associate load balancing primarily with the higher throughput, this technique can be used in other important scenarios as well.
Tag Archives: performance
New Json.NET is here – smaller and faster
The latest release of Json.NET has a lot of improvements which make it preferable to other techniques. The team has done really a great job to increase the speed of both serialization and deserialization.
Json.NET is faster than both the JavaScriptSerializer and the WCF DataContractJsonSerializer over all scenarios. It reached the level of the XML based DataContractSerializer which is pretty remarkable. Json.NET over binary (BSON) is considerably faster than the .NET BinaryFormatter, too. Another one of the benefits of JSON is its smaller size when compared to equivalent XML. The output of Json.NET is less than half the size of the XML that DataContractSerializer produces. Read more about these tests on James Newton’s post.
Download the latest release of Json.NET and try it yourself!
Arranging Numbers at Random
Let’s say we want to arrange the numbers from 1 to 100 at random. This is a little confusing problem but there is a solution (not only one) for it. The basic way is the following: you have an array where you put your numbers, you generate a random number while this number is not contained in your array, then you add it to the array. Well, this method is very sluggish! When you add numbers to the array you decrease the size of the multitude of possible numbers. And when this size is too little, the while cycle loops very long until you get a random number, which is not already added to the array. Here is this example. I have used a stopwatch to count the necessary time for this method to finish. Continue Reading…