• Competitor rules

    Please remember that any mention of competitors, hinting at competitors or offering to provide details of competitors will result in an account suspension. The full rules can be found under the 'Terms and Rules' link in the bottom right corner of your screen. Just don't mention competitors in any way, shape or form and you'll be OK.

CPU and Websites

Soldato
Joined
8 Nov 2006
Posts
23,355
Location
London
I have a quick question. Something that has really started to annoy me in the past year.

Why do websites max out the cores of even the latest processors?

Take for example the LinkedIn website which is hardly advert or content intensive. On chrome the scrolling takes ages and visibly slows down as you start scrolling through content.

The likes of Facebook or any of the newspaper websites are much worse. Then there are the advert and spam advert heavy websites.

How do people using dual core processors even browse the internet? Each tab will just max out a core.

Combine this with dynamically loading websites which load content as you scroll (often infinitely) memory usage spikes and internet latency is put to the test.
 
Last edited:
I think there might be something wrong with your system cause I have spent the last 2 weeks on a laptop with an i5 2520M and 8GB of RAM, using chrome without adblock without any noticable slowdown or lag as I scroll. Even with twitch running in the background which will use about 50% of my CPU at all times.

Having a little play about on Tom's Hardware does cause my CPU usage to climb massively (around 70) if I rapidly scroll through the endless news articles but as soon as I stop it goes back to about 30%. Bare in mind that Tom's hardware has a horrendous amount of adverts (including some autoplaying videos). But as soon as I tab away from it the tab goes back to less than 5%.

Both Facebook and OcUK Forums are the same in that intense scrolling (dragging the scroll bar) causes the CPU to get to about 50% but as soon as I stop it goes back to <5%.
 
But you are highlighting my point. 50% usage on a dual core processor is maxing out one of the cores.

Kinetic scrolling means, rapid scrolling is very common.

edit:

Dragging the scroll bar is different though. That scrolls instantly to where you want to go. However, use the up down arrows and you get the same problem.
 
Last edited:
i think its mostly the move towards gpu accelerated stuff
like i could have lots of twitch open and under 10% cpu usage but look at the gpu doing all the work and using 2gb+ vram
its great if your gpu can do it, on older systems that would use crazy amounts of cpu

anyway give edge a try if you want smoother scrolling, thats for sure something chrome needs to work on
 
But you are highlighting my point. 50% usage on a dual core processor is maxing out one of the cores.

Kinetic scrolling means, rapid scrolling is very common.

edit:

Dragging the scroll bar is different though. That scrolls instantly to where you want to go. However, use the up down arrows and you get the same problem.

But it was only maxing the core momentarily. The scrolling I was doing was highly synthetic, with the arrow keys it was down to about 40%, dropping to below <5% as soon as I stopped. I was dragging the scroll bar up and down as fast as possible.

Why do websites max out the cores of even the latest processors?

The CPU is trying to process the webpage as fast as possible hence high usage for a short period of time. Which is much better than low usage for a long period of time.

How do people using dual core processors even browse the internet? Each tab will just max out a core.

Only whilst scrolling, as soon as you stop usage drops massively. Once a tab is in the background it uses negligible resources unless it's a video or something. Low memory usage is massively overated. Unused RAM is wasted ram.

I turned on uBlock origin and switched to HTML5 on twitch and now cannot get above 50% CPU usage.
 
Basically the answer is huge piles of unoptimised and extraneous Javascript.

This. HTML wasn't designed for the kinds of websites that exists now so everything has to be crowbarred on, adding extra resource overhead. The gradual elimination of Flash is helping but Javascript is definitely still a problem.
 
This. HTML wasn't designed for the kinds of websites that exists now so everything has to be crowbarred on, adding extra resource overhead. The gradual elimination of Flash is helping but Javascript is definitely still a problem.

The W3C (the consortium that oversees web standards) couldn't find their arse with both hands and grep -r. Additionally they move at a speed that would frustrate a glacier. HTML5 is... okay. I mean it's a mark-up language and designed for display and it works passably well for that. Though their namespace attribute idea they introduced with HTML5 is like trying to shoe-horn a hippo into a champagne flute. It's when we come to the DOM + Javascript that things start to creak.

For a start, Javascript is NOT a good language. It's not strongly typed, its riddled with inconsistencies, half of the language features of value are shimmed in by popular frameworks. And the DOM itself is pretty dubious. Getting elements cross-hierarchy by element type or an attribute value... What happened to proper inheritance? Why this sledgehammer that shatters encapsulation into a thousand bits.

Plus HTML was intended to be stateless and now you have AJAX trying to turn it back into stateful programming (which can work when people know what they're doing but half the time they don't). Don't even get me started on the subject of Same Origin Policy and what a ****-up misconceived attempt at security that has been.

The best attempt to bring some order to Javascript and the DOM is (hands up everyone who thought I was about to say JQuery) Microsoft's TypeScript. It's an open standard and backwards compatible with Javascript. I think the best option now is for browser makers to start reading that as a language in itself and at least we'd have a start. Although Google would fight that to its dying breath, of course. They had their chance with Dart which was atrocious and also favoured their own browser massively.

A decade ago, there was hope that Python might become the website programming language of choice, but sadly that did not happen.
 
Basically the answer is huge piles of unoptimised and extraneous Javascript.

This again, and h4rm0ny's post above.

You could try disabling javascript OP, but it wouldn't really be a fair test as plenty of websites break without it.

I previously did this (disabled JS) on a netbook with a very weak Atom CPU and selectively enabled it on sites where it was critical. Since then I've switched from Adblock to uBlock Origin and it's not so necessary. You might try the same.
 
This. HTML wasn't designed for the kinds of websites that exists now so everything has to be crowbarred on, adding extra resource overhead. The gradual elimination of Flash is helping but Javascript is definitely still a problem.

Bingo.

The awesome thing about JS is that anybody with a computer and a browser can jump in and have a go. The worst thing about JS is that anybody with a computer and a browser can jump in and have a go.
 
Sorry i havent read through all the comments but have ya tried going to chrome://flags/ and disabling Smooth Scrolling? If i start scrolling my CPU usage goes from 1-3% to 10-12% but both my pcs are i7s so i dunno if it compares.
 
Last edited:
Bingo.

The awesome thing about JS is that anybody with a computer and a browser can jump in and have a go. The worst thing about JS is that anybody with a computer and a browser can jump in and have a go.

:D

I've always said the same thing about PHP. :)
 
Back
Top Bottom