I can't wait!

Brian Shire's been a bad boy.

Tekrat tests the computer controlled vinyl cutter.

Tekrat wrote me today:

So TechShop SF is finally open so that means I can finish up a lot of projects I’ve been meaning to do. One on the list was this graphic I wanted to print up a while ago. Unfortunately the one I tried on my laptop was the only one that came out right today 😀 Is the Macbook Air have the same as the Macbook Pro? As soon as I get my new blades I can cut another…

Unfortunately, the answer is no.

Stacked Apples

iPhone 4, iPad, MacBook Air 13″, MacBook Pro 15″, MacBook Pro 17″

Must. Be. Patient.

Champagne Starbucks

Shared a morning with two friends who are leaving Facebook after four years. Then I noticed I was the only one with ratty shoes.

I’m the only one without the cool shoes
Starbucks, South of Market, San Francisco, California

Leica M8, Cosina-Voigtländer NOKTON Classic 40mm f1.4 S.C., B+W 486 IR Cut
1/125sec, iso160, 40mm (53mm)

Even Cyan was sporting the Kitteh.

Oh well, one of the nice things about living here is other people have taste.

Autoloading and Lazy Loading

Two and a half years ago, when first wrestling with the Tagged codebase, I asked Andrei about replacing all my PHP includes with __autoload. I was told under no uncertain terms to not do this.

I did it anyway.

It’s not that Andrei is wrong in his admonition. Far from it! For reasons that I don’t quite care to know, there are caching and lookup optimizations that APC cannot do when it has to switch context to run __autoload. But the problem in practice was two-fold:

  1. The company was bug-driven and the easiest way to eliminate an “Undefined class” error was to go into the preinclude script and include it. Voilá! problem solved at the expense of code bloat. (This bug happens often when deserializing nested objects from cache.)
  2. There are slowdowns when you use include_once where include would do, or when you don’t use the full path in your include, or when you construct your full path from symbols. How many of us do this? Heck, I’m still trying to get used to the idea of include_once and require_once. Ahh the days when I’d have to write symbols with every include file!
  3. More to the previous. If you have deep dependencies and don’t use a FrontController pattern, you’re going to have to use require_once() which will get executed multiple times. An __autoload only gets executed once.

At a certain point, optimization gives way to convenience and practicality.

For Tagged, this was that PHP would allocate 12MB/80ms to say “hello world”, 20MB/465ms to display the homepage, and 22MB/1965ms/1207ms to return my profile page

After the rewrite it takes 0.3MB/3ms to say hello world and 3.7MB/109ms to return my profile page.

Continue reading about lazy loading after the jump