Feeds

Google to relieve AdSense webpage drag

Scripts a future free from browser hang

Top three mobile application threats

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

Build a business case: developing custom apps

More from The Register

next story
BBC goes offline in MASSIVE COCKUP: Stephen Fry partly muzzled
Auntie tight-lipped as major outage rolls on
iPad? More like iFAD: We reveal why Apple fell into IBM's arms
But never fear fanbois, you're still lapping up iPhones, Macs
Philip K Dick 'Nazi alternate reality' story to be made into TV series
Amazon Studios, Ridley Scott firm to produce The Man in the High Castle
Stick a 4K in them: Super high-res TVs are DONE
4,000 pixels is niche now... Don't say we didn't warn you
Amazon Reveals One Weird Trick: A Loss On Almost $20bn In Sales
Investors really hate it: Share price plunge as growth SLOWS in key AWS division
Bose says today is F*** With Dre Day: Beats sued in patent battle
Music gear giant seeks some of that sweet, sweet Apple pie
There's NOTHING on TV in Europe – American video DOMINATES
Even France's mega subsidies don't stop US content onslaught
You! Pirate! Stop pirating, or we shall admonish you politely. Repeatedly, if necessary
And we shall go about telling people you smell. No, not really
Too many IT conferences to cover? MICROSOFT to the RESCUE!
Yet more word of cuts emerges from Redmond
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
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.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.