Skip to content
Advertisements

Ad code ‘slows down’ browsing speeds


Poorly written code can make some pages very slow to load

Ads are responsible for making webpages slow to a crawl, suggests analysis of the most popular one million websites.

The research by developer Patrick Hulce looked at which chunks of code take longest to load.

About 60% of the total loading time of a page was caused by scripts that place adverts or analyse what users do, he found.

But using ad-blockers may not be the best way to avoid delays and speed up the loading of webpages, he said.

Bad blocks

Mr Hulce gathered data from both desktop and mobile versions of popular sites on which he sampled programs written in the Javascript language. This is typically used by developers to make sites interactive and also helps them display ads or log what users click on.

He found that the Javascript code helping Google place ads on pages and analyse user activity bestowed the longest delays on visitors. The Javascript behind Google ads and its analytics system were found on the largest number of sites in the million sampled, Mr Hulce told The Register news site.

If used together on a site, these can add more than two-thirds of a second to loading times, he found.

There were some ad-serving scripts written in Javascript that imposed longer delays, but these were used on a much smaller proportion of sites, the analysis found.

The worst offender was the WordAds script for WordPress blogs that, all by itself, can delay the arrival of an entire page by up to 2.5 seconds.

Not all delays were down to ads and analytics, said Mr Hulce. Other factors such as network delays and big file sizes for some content could also contribute to slow loading times.

In addition, he said, greater use of ad-blocking programs may not always improve browsing speeds.

Ad-blockers can end up “triggering convoluted workaround logic and complex disguising of ads that increase script execution time”, he told The Register.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: