Feeds

Google advises flushing your website

Lessons in load time

Secure remote control for conventional and virtual desktops

Web 2.0 Expo Steve Souders is the sort of person who spends his Saturday afternoons measuring website load-times. "You might watch football games," he says. "I watch websites load."

After founding the Exceptional Performance Group at Yahoo! - an effort to improve website speed from the websurfer's point of view - Souders now does similar work inside the Google Chocolate Factory. And on Thursday afternoon, he trumpeted his newest load-time tricks at Tim 2.0'Reilly's Web 2.0 Expo in downtown San Francisco.

Souder's over-arching philosophy is that the best way to improve load-times is to focus on front-end performance. When the typical webpage loads, he says, between 80 and 90 per cent of the wait time occurs after the html document has already arrived.

"In that html document is a manifest where the web developer has dictated what else should be dictated in what order," he told gathered dev types this afternoon, pointing to some typical load-time stats for iGoogle.

"Only about nine per cent of the time the user waits for the page to load is spent getting that html document. The other 91 per cent is all other activity that's driven by client - other http requests have to be made, CSS has to be parsed and applied, JavaScript has to be executed, etc."

Even with a primed cache, only about 17 per cent of iGoogle's wait time is spent on html.

With his 2007 book High Performance Web Sites, Souders detailed fourteen rules for improving front-end performance - yes, it's a Tim 2.0'Reilly tome - and he's now prepping a second book that lays out a whole new bag of tricks.

One of these is best applied to those websites that belie Souder's Performance Golden Rule: sites like Facebook take an unusually long time delivering html. "A page like Facebook takes a long time to do all the database queries to find all your friends and all their comments and all the feeds and stitch everything together. You might have that page spending 30 to 50 per cent of the overall load time just getting the html document."

With such sites, Souder suggests that developers lean the "flush" function available from most popular web programming languages, including PHP, Perl, Python, and Ruby on Rails. With flush - "autoflush" in Perl and "ios.flush" in Ruby - you can start sending your html before the entire document is queued up.

"You can can get enough of the html to the browser so that the browser can parse it and start downloading other resources even though the rest of the html is still being stitched together on the back-end," Souder said. "What flush does is it says 'Whatever you have queued up, send it down to the browser right now.'"

Souders also has a new-found obsession with simplifying CSS (cascading style sheet) selectors. He urges developers to avoid universal, descendant, and tag-child selectors, while sidestepping qualifiers for ID and class selectors.

And when using CSS, he says, you should avoid the @import rule, a way of creating a style sheet within a document and then importing additional rules. If used incorrectly, as Souder says it so often is, @import is a particular drag when pages are loaded on Internet Explorer, which may delay other scripts and other style sheets and scripts until an @import style sheet is loaded in-full.

You can read all his esoteric CSS advice here (PowerPoint).

According to Googler Steve Souder, Google is the only top-ten web property that has bothered to flush its html early. But he's not one to avoid criticizing his employer. He isn't exactly pleased with the drag that Google Analytics and Google AdSense put on third-party websites across the web. But, apparently, he's "working on it." ®

Bootnote

While at Yahoo!, Souders developed a tool known as YSlow that automatically measures website load-times. You can download it here. ®

The essential guide to IT transformation

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
China hopes home-grown OS will oust Microsoft
Doesn't much like Apple or Google, either
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
5 things you didn’t know about cloud backup
IT departments are embracing cloud backup, but there’s a lot you need to know before choosing a service provider. Learn all the critical things you need to know.
Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?