Feeds

Google to relieve AdSense webpage drag

Scripts a future free from browser hang

Choosing a cloud hosting partner with confidence

Velocity Google has admitted that its AdSense text ads can account for 12 per cent of a webpage's load time, but the company is testing a revamped script designed to minimize the amount of time Google ads spend blocking pages.

Speaking this morning at the internet-infrastructure obsessed Velocity conference in Santa Clara, California, Google mathematician Michael Kleber said the company has been testing its iframe script for about a week on live sites. Crucially, the new script does not require website publishers to change their AdSense code.

"We want to minimize the amount of time we spend blocking the publisher page," Kleber said. "We want a webpage to be as fast with ads in it as without. But we want to do it without having publishers recast. We want to do it without them changing anything on their page, because, you know, AdSense is on millions of websites, and there's no way we're going to get millions to changes their pages.

"We want to have this work by default and not just for elite webmasters that keep up with best practices."

The company's solution is to replace the existing 40K-ish "show ads" AdSense JavaScript (show_ads.js) with a tiny loader script that creates an inline frame on the publisher's webpage. The rest of the script executes within that iframe, separately from the page itself.

With the old "show ads" setup, when the page downloads the script, all sorts of other tasks stop as the browser works to execute the code. But with the iframe setup, Google can access the same code path without causing the same stoppage.

"The remarkable thing is that it works and it's very fast," Kleber said. "Even though the script running inside the publisher page doesn't lock the publisher page from doing all the other things it wants to do, we still execute as quickly as possible, right on top of the stack."

According to Kleber, the median time that the old show ads script spent blocking the page was 47ms, and in the 90th per centile, this figure jumped to 288ms. With the new iframe script, the median figure drops to 11ms and in the 90th per centile the number dips to 32ms.

Kleber said there are still some problems with the setup, related to disparate setups among the various browsers. With Internet Explorer, for instance, some ads may be blocked when multiple iframe scripts are loaded at the same time. There are also issues related to using browser forward and back buttons. Sometimes, when you return to the page, the script will use the ads already there rather than re-fetching.

But Kleber hopes to roll out the new setup to more AdSense sites "in the very near future." Yes, there are similar problems with other Google services, including Google's DoubleClick ads and Google Analytics. But Kleber said that these don't slow webpages nearly as much as AdSense.

Google Analytics, he said, accounts for about 5 per cent of a webpage's load time. And with the new asynchronous Google Analytics snippet, he added, this figure should drop. ®

Security for virtualized datacentres

More from The Register

next story
Inequality increasing? BOLLOCKS! You heard me: 'Screw the 1%'
There's morality and then there's economics ...
Spies, avert eyes! Tim Berners-Lee demands a UK digital bill of rights
Lobbies tetchy MPs 'to end indiscriminate online surveillance'
Google hits back at 'Dear Rupert' over search dominance claims
Choc Factory sniffs: 'We're not pirate-lovers - also, you publish The Sun'
While you queued for an iPhone 6, Apple's Cook sold shares worth $35m
Right before the stock took a 3.8% dive amid bent and broken mobe drama
How the FLAC do I tell MP3s from lossless audio?
Can you hear the difference? Can anyone?
4chan outraged by Emma Watson nudie photo leak SCAM
In the immortal words of Shaggy, it wasn't me us ... amirite?
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
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.