Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why programming is fun

elbeno, 8 July, 200629 July, 2007

This week I have been working with a colleague on optimising a piece of code. Last week, what we started out with (a first implementation) was taking over 80ms to run in my test case. We had confidence that the overall algorithm was the correct one for the job, so even without that (usually most fruitful) source of optimisation, and just by changing the code around, converting a recursion to a tail-recursion and then a loop, inlining some other functions and simplifying the resultant code, and implementing a simple caching scheme, we have achieved a one-hundredfold speedup. The same test case runs in about 0.8ms. And that’s just having altered the C++ – we haven’t even started on the highly platform-specific assembly-level optimisations that we could do.

There can’t be many jobs where you can say at the end of the week that you made something one hundred times better.

Programming

Post navigation

Previous post
Next post

Related Posts

RotateAVI updated

15 April, 200729 July, 2007

The latest version has a minor update. Nothing functional, just a display thing. But every little thing makes it a bit easier to use. Rotate AVI files from your digital camera easily!

Read More

Books I keep at work

4 October, 2007

The working bookshelf of a games programmer.

Read More

How to print anything in C++ (part 1)

1 February, 201530 June, 2015

Part 1 Part 2 Part 3 Part 4 Part 5 Postscript I thought I’d have a go at writing some code that could print things. A pretty-printer, if you like. What I want to be able to do is this: // Print x correctly, where x is ANY type. cout

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes