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

Lisping towards enlightenment

17 December, 200729 December, 2007

Me: a C/C++ programmer of 12 years (professionally), a Lisp dabbler (programmer is too strong a word to use here) of, let’s say ~3 months. I’ve done enough functional stuff to be comfortable with that side, but I haven’t (hadn’t) yet written a project big enough to get me used…

Read More

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

2 February, 201530 June, 2015

Part 1 Part 2 Part 3 Part 4 Part 5 Postscript Callable things. There are several types: functions member functions std::functions bind expressions lambdas objects that support operator() (function objects) So, going back to my tag code, so far (with everything I’ve added) and including callable things, it will look…

Read More

fighting the code

25 March, 200729 July, 2007

Why doesn’t automake/autoconf properly recognise the way to use Flex/Bison with C++ scanner/parser generation? I use a .ll file and it thinks the output is going to be a .c instead of a .cc. Likewise I use a .yy file and it screws up the includes in my bison output…

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