Friday, April 21, 2006

m-m-metablogging

Ah sweet, sweet linkage, and a gauntlet thown down too. Though frankly I can't see how a posting here could be more effective at inducing a blog posting than dropping into his office and saying "update your freakin' blog already!" as I am wont to do.

I've never needed to use the possessive form of zar', but then I'm not fond of writing about myself in the third person. Having now seen someone else deal with it I realise that it results in a bit of a mess. It's almost as twisted as the origins of the handle (which I won't go into as I expect the intersection of 2001: A Space Odyssey fans and Robotech fans is pretty much guaranteed to be the null set). A blog may be an exercise in vanity, but even I'm not so delusional as to think anyone would actually be interested in that. If I'm going to have a blog and pretend people are going to visit, I figure the least I can do is give an opinion like, say, how no one knows how to program any more (a.k.a. my very first post), what makes a good (or bad) remote, or how oncoming drivers on nearly-empty streets are trying to kill me. At least the hypothetical readers of such posts are likely to be entertained. Expounding on the genealogy of a four character alias seems more likely to, at best, drive people away.

Yes, those topics are an indication of things to come. You expected something else from a paranoid tech-junkie fan-boy? I have said, on many occasions, to many people, that the only thing I have going for me is my brain. I happen to like thinking. If you're foolish enough to come back here, I have every intention of making you think too. You have been warned. I guess I'll know if I've succeeded when the hate mail starts rolling in.

Labels:

Tuesday, April 18, 2006

Every Cycle is Sacred

Until about a year ago I'd spent a good four or five years doing Windows CE programming. Not application programming, but OS/OAL/bootloader programming. Now I'm working on code that runs on a 16 or 33MHz Dragonball (68328) processor and it's so much more satisfying.

The CE machines had clocks running at several hundred megaHertz, 32-64 megabytes of RAM and FLASH. The machines I'm working with now have only 256kB or 1MB of RAM and four or eight megabytes of FLASH. So how could I possibly be happier?

Every. Cycle. Counts. The fastest instruction takes four cycles, some take dozens (logical shifts). My first big project at this job involved choice between developing a new special-purpose algorithm or tuning a core routine. I compiled that core C routine to assembly and hand-optimised it. Lovingly hand-optimised it. The end result shaved 40% off the execution time. It's not that the compiler was bad, it actually did some very clever things, and I made sure I kept the good bits. Making this program run faster was interesting and challenging because I couldn't just throw a faster CPU or more RAM at the problem and make it go away.

Who does this anymore? Who knows how to do this anymore? Yes, I realise that hand-optimising assembly code for a non-stalling RISC processor is the fast path to insanity, but come on. Optimising isn't always about programming down to the bare metal, sometimes it just means thinking about the problem first. Just because you think you have cycles and RAM to burn doesn't mean you use any old BFI algorithm. Programmers should think more not less.

Labels: