back to article Want longer battery life? Avoid the New York Times and The Grauniad

Software developer Santeri Paavolainen says the code powering today's websites is taxing browsers so much, it's having a significant impact on power consumption. The programmer came to that conclusion after a casual examination of news sites including the New Scientist, the BBC, Forbes, The Guardian, and The New York Times, as …

Page:

  1. Anonymous Coward
    Anonymous Coward

    Amazon

    I'd be surprised if Amazon UK wasn't another to add to the list. Whatever they've done in the last six months, it positively grinds with more than half a dozen tabs open, and scrolling gives up entirely on some pages.

    1. A Non e-mouse Silver badge

      Re: Amazon

      I find I'm visiting Amazon less and less as scrolling on their site is painfully slow.

    2. Anonymous Coward
      Anonymous Coward

      Re: Amazon

      Some web pages only render one screen at a time (ok, plus 1/2 of a screen above and below). tumblr and google images are semi-good examples. Both of these sites will kill my Firefox on Fedora after scrolling through 10 to 20 pages.

  2. Mark Simon

    The Ecological Case

    The article doesn’t have much detail on the actual causes of excessive power consumption, but some of it must include over-use of inefficient JavaScript and CSS, as well as the usual suspects of Flash and, well, more Flash.

    I’ve been telling people for years that there’s both a business case and an ecological case for writing clean code and not wasting too much effort supporting Legacy™ Browsers.

    Roughly, that means leaving IE with what works well enough without excessive polyfills, and not bloating your site with libraries which, despite their qualities, are often used to perform a job done more simply without.

  3. Anonymous Coward
    Anonymous Coward

    Local newspaper

    My local newspaper's website is dire (Cambridge News). Well, I never knew it was dire, as I take the usual precautions, until I heard people complaining about it and I saw it how the designers intended. Ouch!

  4. Andy Non Silver badge

    I've noticed the effect.

    I use an old, low spec laptop running Linux and Firefox and notice that if I leave a facebook page on screen the computer runs hot and the fan keeps going, but if I leave El Reg open instead (or most other websites), the fan stops. As I don't have flash installed on this machine and use Adblock+ I can only assume it is related to facebook refreshing parts of the page using Java Script. Facebook won't work anyway without this enabled. It continually updates the notification area and indicates which of my "friends" are online. Must be quite a power gobbler.

    1. Bloakey1

      Re: I've noticed the effect.

      <snip>

      "Must be quite a power gobbler."

      That made me smile. I had visions of the eighties, shoulder pads and lots of hair and a certain secretary who .....

      For those of you running Firefox, have a look at lightbeam and see what it tells you about your favourite sites.

    2. Boothy

      Re: I've noticed the effect.

      I used Adblock+ to block all the frames down the right hand side of the Facebook page. So all the chat, notifications, game page links etc.

      Also using the mobile pages on a desktop work very well. (I do that with The Reg quite often :-) ).

      I also run Ghostery.

      I don't seem to have any issues with CPU utilisation of 'idle' pages now, and I typically have around 10 tabs open at once. (Mostly work related, but there is FB, gmail, outlook etc sat in the background (Chrome)).

      Ghostery + ADP = Reasonably pleasant browsing experience. :-D

  5. Mr Fury

    JavaScript?

    Wouldn't be too shocked to see if some of this was down to JS polling for data - a lot of places are still using setInterval (okay, I do too for internal stuff) rather than websockets pushing updates. I imagine that hitting a page every x seconds, along with the browser processing the response, will ramp up battery use.

    A lot of JS development is bloody lazy too (again, guilty at times myself) with a reliance on jQuery rather than using native methods because it's easier, so loading up libraries and the extra processing from jQuery won't help.

    Single/Minimal Page Applications should be *less* intensive, but that all depends on the person coding the damn thing...

    1. Anonymous Coward
      Anonymous Coward

      Re: JavaScript?

      Is this why most, if not all, browsers now throttle background tabs which makes using tabs unusable for anything except text pages?

    2. Kubla Cant

      Re: JavaScript?

      The JavaScript framework du jour seems to be AngularJS. Unlike JQuery, where the script is essentially driving the application in response to browser events, AngularJS seems to use some kind of continuous polling. It's a pleasure to work with: you can bind HTML tags to script variables declaratively, and see them all updated when the value changes, but I can't help wondering what kind of overhead this incurs. What's more, the preferred AngularJS architecture involves loading everything into one single-page application, so you'll have a substantial memory footprint as well as a busy processor.

  6. techmind

    Inefficient bloated code increases power consumption - who'da thought it!

    "Software developer Santeri Paavolainen says the code powering today's websites is taxing browsers so much, it's having a significant impact on power consumption."

    It's a common observation that visiting certain websites or running particular applications causes the fan to rev up.

    I got out of the habit, but for a long time (probably owing to my small-time developer mindset) I always used to keep a task-Manager running in the bar. It's revealing to see when that processor usage start to rise (and processor usage is likely a reasonable proxy for power consumption.)

  7. DropBear
    Facepalm

    My favourites...

    ...are those bloody stupid but increasingly common sites that insist to open with a full-page full-motion 4K video loop in the background. Guess what that does to bandwidth / CPU load / power consumption (especially if I don't switch to the relevant tab right away after opening it, so it gets to play in the background for eternity - and before anyone says "it's not running while not in focus" I hope you're aware it's perfectly possible to fully watch any number of Youtube videos in parallel without actually seeing any of them play...)

    1. Andy Non Silver badge

      Re: My favourites...

      YouTube has caught me with that. Watched a short video a while ago, only a few minutes long and got up to make some lunch just as it was finishing. In the meantime the screen saver kicked in and I didn't return to the computer for the rest of the afternoon. Moved the mouse in the evening and discovered YouTube still playing and gobbling bandwidth showing videos of its own choosing to... nobody. Damn that "automatic play next" feature and its default to yes.

  8. Anonymous Coward
    FAIL

    Trend setters

    NYT, Facebook, Twitter - they open-source a lot of their bloatware and frontend devs eat it up. It's 'best practice'. Underscore, Backbone, Bootstrap, Coffeescript(?), maybe AngularJS (notorious hog), and layers on top of all these, and soon WebComponents.

    Seems like a good idea at first, enabling modular/functional programming in JS, but the temptation to overleverage it is irresistible.

    P.S. - installed NoScript for the first time in 5+ years. Renders 90% of sites unusable but so be it. This is getting ridiculous.

  9. xybyrgy

    NYT Cost

    Thank goodness NYT costs $195/annum! I used to read it every day...

  10. CanadianMacFan

    Methodology

    Looks like each site was only tested once. Seven measurements for 30 seconds after the page was loaded but I could only find that the page was loaded one time. So it's entirely possible a background task like indexing for the spotlight search or an hourly task impacted the result for the NYT and made it look like it was the coding. Loading the test five or ten times for a reloaded page (ideally restarting the browser and loading the page fresh from a blank page) would smooth out those events. I'm not saying that it isn't the NYT but with a single data point it is hard to make assumptions.

    While there was a good effort to try and stop other processes from running in the background, such as turning off Time Machine, there are many behind the scene tasks and jobs that can't be turned off and can impact with the results.

    It might have been better to start the Mac in "safe" mode where a lot of these extensions aren't started. Then create a new profile in Firefox with no extensions and have it start up with a blank page. For each page to test start the browser, go to the page, wait until it loads, run the measurements, and quit the browser. Repeat the test until you get your five or 10 samples. Move onto the next page to test in the same manner.

  11. Henry Wertz 1 Gold badge

    Bad javascript

    Yeah, I have not run powertop to measure my actual power use, but I will go to some sites and firefox and Xorg are just chugging CPU time with nothing visible happening onscreen. I speculate some banner ads may have horribly written Javascript that (despite no actual animation) redraw the banner either as fast as possible or at some high frame rate. I'm interested into looking into if firefox has any options to throttle this naught javascript.

Page:

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like