Extra speedy H2D2 on the Mac

I remember there was a time I was very happy because H2D2 was running my Mandelbrot test program in about 650 milliseconds (whereas the original proof of concept, DALIS, took nearly 12 seconds to do the same thing).

Since moving over to my new MacBook and compiling the H2D2 source using Xcode, just look at the result now:

Whoa! 72 milliseconds! Now that's impressive. This new MacBook is pretty fast, but I'm sure the Apple LLVM compiler is also playing its part in achieving that level of speed. I have done some optimisation work in H2D2 recently, but I don't think I can take the credit this time.

It really pays to do this type of 'system level' programming in C (plus I enjoy it of course). Right, I'm off to work on parsing string expressions now...

H2D2 … now on Mac OS X

OK, first of all, I've bought a new laptop, and it's a Mac - a 13" MacBook Pro to be precise, the one with the Intel Core i7 processor, 8Gb of RAM and 750Gb hard disk. After having great success with running things as VMs at home, I've decided to do the same on my laptop. But the old Toshiba T130 was just not powerful enough to do that (it seemed like quite a powerful laptop when I bought it, but that was over 4 years ago I think). Besides, the Toshiba was feeling quite slow anyway.

But I came to realise that if I was going to run all my stuff as a VM, then I didn't need Windows as the host OS. And getting a new shiny Apple piece of kit seemed like a pretty good choice. I've virtualised the old (Windows) laptop and now it's running happily as a VM in VirtualBox on my new MacBook. Pretty seamless really.

But, I then went and downloaded Xcode (Apple's IDE) and quickly realised that it will happily support plain old C programs. So I copied the H2D2 codebase from Pelles C on Windows into Xcode on the Mac. It compiled and ran first time - even I was surprised. But that is what is supposed to happen when you write portable C code - you can run it natively on just about any platform.

So, I'm going to carry on developing H2D2 in Xcode for a while and see how that goes. My initial impression is good, I'm still learning the keyboard shortcuts … but then I'm still getting used to the new Mac keyboard as well. I was surprised to realise that there is no hash (#) key, at least not on the UK Mac keyboard. Maybe twitter isn't as popular amongst Apple users as I had thought. Or maybe that's just because I think of Steven Fry when I think of a typical Mac user :-)

Anyway, I'm still finding my way round the IDE at the moment. It's probably too soon to draw any final conclusions. Maybe I should buy a book on Xcode...