Recursion and iteration – loop unrolling

This article is part of a series on recursion and iteration: Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling In this article I will talk about loop unrolling, and the wonder / horror that is Duff's device. Image credit Loop unrolling Loop unrolling is something to do only when you're very … Continue reading Recursion and iteration – loop unrolling

Recursion and iteration – an introduction to iteration

This is the first of a series of articles about recursion and iteration Introduction to iterationIntroduction to recursionMutual recursion and tail recursionBlurring the linesLoop unrolling Recursion and iteration are both techniques for doing some work (or similar work) repeatedly, so that you can solve a bigger problem. This could be things like summing all the … Continue reading Recursion and iteration – an introduction to iteration

P = NP?

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?

Performance optimisation – for machines or people?

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?