This article is my attempt to put my money where my mouth is. A friend mentioned the BBC Radio 4 series In Our Time on Facebook, and in the conversation that followed I said that the only time In Our Time discussed something close to my home turf I got grumpy about how poorly I … Continue reading P = NP?
Introduction If you hang around programmers for long enough, you might hear people use terms like complexity or Big O notation, or say that performance is of the order … such as of the order N squared. I hope that this article makes those terms a bit less confusing. The basic idea is seeing how … Continue reading Complexity: Performance trends in code
I recently watched a video and listened to a podcast that form an interesting pair of opinions about performance. The video is Patterns for high-performance C# and the podcast is SE-Radio Episode 357: Adam Barr on Software Quality. There are two things where the podcast and video have no differences: the system must behave correctly, … Continue reading Performance optimisation – for machines or people?
Lazy initialisation is a way to set up everything needed to initialise something, but put off the initialising until later, usually when the value of the thing-being-initialised is needed for the first time. You might want to use lazy initialisation because something is expensive to initialise, and you might not need it. Or because you … Continue reading Lazy initialisation and threads (in C#)
I'm still slowly working my way through the back catalogue of the Software Engineering Radio podcast. One episode that I particularly liked is 277: Gil Tene on Tail Latency. It has interesting and useful stuff that helps you see things clearly. For instance: How there's more than one measure of latency (mean, median, 90th centile, … Continue reading S.E. Radio podcast on latency
This could also be entitled: How to make your code over 3x faster*. I love LINQ in C#, and I think that I'm not the only C# programmer who does. However, there are hidden problems to watch out for, and I'll describe one now. It is based on the difference between streaming and buffering, which … Continue reading Streaming and buffering in C# and Talend
(*Sorry, the techniques I describe don't apply in all circumstances.) This graph shows the time taken by 8 different ways of doing exactly the same thing: retrieving the details of 20,000 orders from a database. The taller the bar, the more time it took. Unfortunately I had to use a log scale because the range … Continue reading How to make your code 500x faster*