Posts Tagged ‘optimization’

Stoyan’s Performance Advent Calendar And Me

Sunday, December 20th, 2009

Stoyan Stefanov decided to release a post a day during the advent season in an effort to bolster our budding performance community.

He was kind enough to let me participate, not once but twice! My first contribution was called, JavaScript Loading Strategies and my second, which is out today is called, Extreme Performance Optimization.

I hope you enjoy reading them, and be sure to check out the other posts in Stoyan’s performance advent calendar as well!

Don’t Settle For Mediocrity or: How They Crammed 3½ Minutes Of Video Into A 4kB File

Tuesday, April 14th, 2009

A friend of mine just pointed me to the Breakpoint 2009 4K intro winner by RGBA and TBC called Elevated. I’ve got to be honest, I haven’t been as impressed with a demoscene production since Farbrausch‘s Debris (which was 177K). And of course by “K” I mean kilobytes. As in smaller in file size than the images making up the design of this page.

Screenshot of RGBA and TBC's 4K Intro, Elevated

A screen shot from RGBA and TBC's 4K Intro, Elevated

Let me put it to you another way, the images you see above are screenshots from the video. Each represents one frame from the three and a half minute, full-frame-rate video. They both weigh roughly 12K each. Yet two amateur programmers managed to put together three and a half minutes of photo-realistic video running at roughly 30 frames per second, with musical accompaniment into a 4 kilobyte executable. How’d they do it?

Technically speaking they used a technique called procedural content generation. More importantly however, they did it by ignoring conventional wisdom and daring for something normally considered impossible. 3D video producers will tell you that their work is generated on specialized computers and rendered over hours if not days, the final product of which will weigh in the hundreds of megabytes. Yet Elevated (which I embedded below for your viewing pleasure) is delivered in a 4K executable and runs on average hardware. Don’t believe me? Download it and see for yourself! Also read the story behind Elevated in the coder’s own words.

The lesson is an important one, that you can go beyond the status quo to produce something heretofore thought impossible. Too often it seems people follow the Microsoft model, where sluggish code relies on newer, faster hardware to pick up the slack. Why not shun the norm and dare to push the limits of the medium you work in? Whether it’s 3D, game programming, web development or what have you. Be inspired by the work these guys did and blaze a trail of your own!

Bandwidth, it isn’t all for you.

Wednesday, March 19th, 2008

I love web development best practices. I’m always looking for better, more efficient and more reliable ways of doing things. Gaining that knowledge isn’t enough though, I want to educate others about it. But I often find that it’s difficult to illustrate my point without concrete examples for why it’s better to do something one way instead of another. Well I found a half-decent real-life example today for why optimization is a good thing.

It happened when I was trying to visit a site and noticed a long delay in its loading time. Immediately I realized that iTunes was downloading 3 podcasts (since I have it set to auto update every hour) and in the process monopolizing my home DSL. That’s when it clicked, your site is likely not the only thing coming down the pipe when it’s being loaded. It’s probably coming through at the same time as streaming music, another site or two, and maybe even few file downloads. So really, at any given moment, you probably are coming through at 56k, if you’re lucky.

Something to consider the next time you’re tempted to balk at optimization.