Feeds

Google advises flushing your website

Lessons in load time

Security and trust: The backbone of doing business over the internet

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. ®

Providing a secure and efficient Helpdesk

More from The Register

next story
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
'People have forgotten just how late the first iPhone arrived ...'
Plus: 'Google's IDEALISM is an injudicious justification for inappropriate biz practices'
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
Mozilla shutters Labs, tells nobody it's been dead for five months
Staffer's blog reveals all as projects languish on GitHub
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
prev story

Whitepapers

Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
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?
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.