The Quickening of Facebook

If you’ve used Facebook in Opera and Firefox, you might have noticed that Facebook is several magnitudes faster in FF, but this has nothing to do with FF’s speed. For FF and IE users, Facebook uses a client-side architecture called “Quickening” that basically makes a few popular pages into full AJAX applications that stay loaded in the browser for a long time. All transitions between “quickened” pages are done through AJAX calls and a cache system makes sure all pages displayed from cache are updated based on changes from the server (e.g. comments others made, ad rotation) or client (e.g. comments you made).

While other sites have certainly done this before, the complexity of Facebook’s apps and level of optimization performed is staggering. The system continuously self-monitors page performance and usage of resources and re-optimizes resources like JS/CSS/sprite images to send and receive as few bytes as possible.

Video presentation goodness: Velocity 09: David Wei and Changhao Jiang, “Frontend Performance Engineering in Facebook”

Miško Hevery Programming Talks

Miško Hevery gave several presentations at Google last year that are worth checking out, I think even if you’re familiar with Dependency Injections and unit testing. They cover the ways that global state can sneak into applications, how undeclared dependencies make classes harder to test and reuse, and how DI in general eases a lot of pain. He’s just a good teacher and the examples are clear and made me want to attack a lot of old code. Hig blog also covers a lot of the same topics.

Physics engine in Sketchup

I knew Sketchup was a great modeling tool, but apparently it’s also scriptable via a Ruby API and embedded web browser. At Google’s IO conference, Scott Lininger showed off some of this awesomeness.

20 min into the video below we see Scott capturing keystroke events within the browser instance and using them to control a modelled character. The character, its surroundings, and even the whole visual rendering style can be edited in real-time with the standard Sketchup tools.

Later he shows this YouTube clip that has more advanced physics demos made with the SketchyPhysics plugin. Wow.

EA skate has just about everything I could ask for in a skateboarding game (another post entirely), but you can’t design your own spots. Next logical step? Build a skateboarding simulator based on SketchyPhysics. The spots are already waiting.

Google TechTalk: OLPC

Another brilliant Google TechTalk, this one on the massive tech challenges of the One Laptop Per Child project.

The revolutionary hardware design was hard enough, but the software goals are incredibly ambitious, particularly in the areas of security and long-term user data persistence within a very small space. Right now the permanent data store is 1Gb of flash RAM, and that stores the OS and apps as well. Every user file will have built-in versioning and they still have to figure out how to intelligently remove old documents and versions that are no longer needed. They want simple, near automated, and encrypted backups to school servers. Security with no passwords, no signed code, the OS runs with the assuption that any running app could be “evil”…as massive deployments of uniform systems these machines could become targets for worms and for use in DDoS attacks.

Another great talk I saw recently was a dissection of the XBOX’s security system and its compromise. The presenter does a particularly great job of entertainingly diagramming and describing the machine-level ideas behind the attacks without assuming much knowledge in the area.

Human cycles not wasted

Luis von Ahn creates simple games that have people solve problems that computers can’t (Google video). Every time you play a game of Taboo, the hinter generates associations between words and the guesser, by guessing the correct word, is verifying the quality of those associations. By isolating players via the web and collecting their responses, on online version of Taboo could generate mountains of data that help computers associate words with other words. Luis took this idea and created several games that use humans to associate words with images, objects within images with words, even words with what they mean… My favorite bit is that, given the same input (eg. a card in Taboo), he gets more good data by recording the actions of all human players and using them against other live players or even other recordings. Eg. Jim and Jane play a game. When Mike comes along, the computer can use Jane’s recorded actions as Mike’s partner. If Steve and Sue also played, the computer could even go back and match Steve’s recording against Jane’s and Jim’s against Sue’s, generating even more data without any human involvement. These “zero player” games wouldn’t give you new associations, but could aid in ranking them.