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 …

  1. Roq D. Kasba

    Ads? Flash? JavaScript animations?

    Let's face it, it's not going to be the text, is it?

    1. Charlie Clark Silver badge

      Re: Ads? Flash? JavaScript animations?

      Network connections being kept open to serve ads and track users mean that the phone's radios have to be kept on.

      Still, it's a novel approach to website performance.

      1. Simon Harris

        Re: Ads? Flash? JavaScript animations?

        Phone?

        The article says 2013 Retina Macbook Pro. Wouldn't fancy holding that up to my ear.

        A retina laptop screen (2560x1600) will have a lot of pixels to animate. It would be interesting to see if the same ratios between power consumption of website renderings applied to a bog-standard 1388x768 laptop and across different browsers.

  2. Steve Davies 3 Silver badge

    and the same tests done with

    things such as Adblock+ , Flashblock and NoScript enabled give?

    1. diodesign (Written by Reg staff) Silver badge

      Re: and the same tests done with

      Lower readings?

      (PS: The guy has Flash blocked by default.)

      C.

    2. Lionel Baden

      Re: and the same tests done with

      would be great to see this as a little browser add-on, how power hungry is this website. scored 1-100

      1. Stuart Castle Silver badge

        Re: and the same tests done with

        "would be great to see this as a little browser add-on, how power hungry is this website. scored 1-100"

        It would be a good idea, but it may be difficult to get accurate readings unless the OS actually makes power consumption figures available to developers. I know OSX (recent versions) tracks this, but I don't know if the readings are made available to developers through an API. I don't know if Windows or Linux even track this, let alone make it available to developers. The browser would also need to enable access to this information but would also need to track what it is doing in each tab. For instance, looking purely at the power usage by each process (which is what the OS would see), you would not get accurate power usage information for a largely text based site if you had a browser window or tab open in the background showing a flash movie.

        Don't get me wrong. This info may already be available via the browsers. If it isn't, it should be.

        1. Lyndon Hills 1

          Re: and the same tests done with

          Not specifically web sites, but Visual Studio has tools that can profile power usage by an app. This is really for apps that you're going to submit to the store, so I guess they're expecting to be installed on Phones/Tablets where this would matter.

        2. Six_Degrees

          Re: and the same tests done with

          Pretty much all OSs have power monitoring abilities. But they're all dependent on the hardware having sensors to gather the information reported. This hardware is quite common on laptops, but pretty much nonexistent on desktop machines.

    3. streaky

      Re: and the same tests done with

      Disable js/css/all plugins and you're good to roll. It'll look like shit and be unusable but hey.. Battery right?

      On this theme amazon.co.uk blows my 2KW desktop PSU every time I use it ;)

    4. Florida1920

      Re: and the same tests done with

      I can't dupe the results now, but when I first put this laptop online last month, the fan kicked in to high speed on the Grauniad site, with ABP and NoScript running. The script(s) that run the Reuters slide shows are another good fan test.

      1. Florida1920
        Megaphone

        Re: and the same tests done with

        Follow-up: Looks like it's guardianapps.co.uk that, when unblocked, runs up the CPU temp. You need that script running to display comments.

  3. Anonymous Coward
    Anonymous Coward

    thought there was a change to the guardian's site recently - when browsing it while listening to podcasts on a MS Lumia the guardian site causes podcasts to quit. Guessing their site is optimised for iPhones given their target audience (and popularity of all things apple)

  4. keithpeter Silver badge
    Coat

    Try this page

    http://www.washingtonpost.com/lifestyle/style/the-old-suburban-office-park-is-the-new-american-ghost-town/2015/07/20/b8e7653a-1f6e-11e5-bf41-c23f5d3face1_story.html

    It has a number of 7000 pixel wide photos in the page with some javascript stuff resizing the images to suit resolution/dpi of page. Eats around 800Mb on Firefox which then crashes on Linux, spanners MSIE and Chrome on the Atom based 2Gb RAM Windows 7 client I use at work - system becomes unresponsive and hard drive is on all the time. According to comments on another forum, it spanners Android based phones as well. I resorted to links in a terminal to actually read the 1000 words!

    PS: lots of moderation happening are we being spammed?

    Coat icon: off out in the rain for the lutz

    1. Aitor 1

      Re: Try this page

      My guess is that some ppl have decided to comment on the publicity on this site.

    2. Anonymous Coward
      Anonymous Coward

      Re: Try this page

      Wow! Firefox went up to 750MB once I turned off NoScript. Oddly enough, IE didn't seem concerned and its use of memory didn't go up much.

      I saw the vanished comments and I think someone was being snarky about the author for no obvious reason.

      1. Anonymous Coward
        Anonymous Coward

        Re: Try this page

        FF on Win 8.1 loaded this page but consumed over 2GB of memory in the process of loading it. When the page completed loading FF memory consumption dropped to 770MB (still a lot but FF is memory hog).

    3. handle

      Re: Try this page

      FF on Linux is happy with this site and it "only" uses 200M, but then I'm running Adblock Plus and Ghostery.

  5. frank ly

    Outside, trying to get in

    Using Firefox; if you use the Request Policy plugin and NoScript (of course) then you can see a list of third party content that the page is trying to pull in as well as the third party scripts.

    As an example, reading an article in The Independent newspaper website right now, it tries to pull in third party content from 25 other sites and 25 scripts from those sites. I block them all and can still read the articles.

    Sometimes you get a blank space in an article and that can be filled by allowing some obvious content delivery network site, if you really want to. Then of course, allowing just one third party content site gives you an entire new set of third party scripts trying to get in as well as a new set of third party content trying to get in. It's a surreal jungle out there.

    I've got to the point where, if i'm keen to see stuff, I give temporary permission for all third party content but close the tab if it needs third party scripts to work.

    As someone earlier mentioned, I've had sites crash my browser under Linux and they will never be visited again.

    1. Lionel Baden

      Re: Outside, trying to get in

      yup, I will temporarily allow scripts till I find the one needed to display content. then allow it permanently, but it is amazing to see how many scripts are trying to concurrently run and what little need they have for it either !!

    2. frank ly

      Re: Outside, trying to get in

      Addendum/Correction

      Now I remember: Certain sites didn't just crash my browser, they caused an instant system shutdown. This was running Linux Mint 13 with MATE on and old laptop. Does anyone know how that can even happen?

      1. keithpeter Silver badge

        Re: Outside, trying to get in

        @frank ly

        Never actually had a *shutdown* on Linux other than thermal runaway when I had a problem with acpi and fan control on Ubuntu 5.10 or something. Might be worth checking the temperature as the computer tries to load the page?

        Trying to load my death-test page (linked above) results in Firefox thinking about it for a bit then deciding to quit. With noscript you can actually load the page but the memory use is very high (1Gb RAM in the netbook).

      2. Bloakey1

        Re: Outside, trying to get in

        "Addendum/Correction

        Now I remember: Certain sites didn't just crash my browser, they caused an instant system shutdown. This was running Linux Mint 13 with MATE on and old laptop. Does anyone know how that can even happen"

        Back in the day I saw web sites and code that crashed routers and modems, anything is possible through bad coding and / or evil genius.

        I am the same as a lot of you, out went the black list and in with the whitelist. the web is turning into a shitty ad infested cess pit.

      3. Missing Semicolon Silver badge
        Boffin

        Re: Outside, trying to get in - Linux crashes

        I suspect that the browser builds don't honour the processor type flags in the build configuration.

        I get a lot of kernel panics on an old Eee PC I think because the diddy Celeron it runs on doesn't support the latest processor instructions.

    3. Anonymous Coward
      Anonymous Coward

      Re: Outside, trying to get in

      Read an article about overuse of 3rd party trackers recently - Politico.com topped the chart by loading 112.

      112!

    4. Dan 55 Silver badge
      Flame

      Re: Outside, trying to get in

      Until fairly recently I would use RequestPolicy and hand craft policies to get rid of social networks, 'elsewhere on the web', and so on like an idiot but now when there are sites which bring in 70 (according to the ad blocker's icon) off-site scripts and hang waiting if one of them goes down which is a fairly regular occurance if there are 70, it's ad blockers all the way.

      And how this set up not be subverted? Last year El Reg was peddling WhatsApp for PCs which was a scam but they probably had no idea that that was what they were pushing.

      If they put a "please please disable your ad blocker" message which I now have on by default to navigate the treacherous waters that are the Internet I might relent if they're not loading a tonne of off-site stuff.

      They brought it upon themselves.

  6. Joseph Eoff

    And the Reg?

    So how does the Register itself stack up power consumption wise?

    1. Anonymous Coward
      Anonymous Coward

      Re: And the Reg?

      El Reg is has a zero carbon footprint. It is powered by the hot air of its readership.

      1. Bloakey1

        Re: And the Reg?

        "El Reg is has a zero carbon footprint. It is powered by the hot air of its readership."

        And also powered by the gasses emitted from bull shit, hyperbole and many a vented spleen.

    2. Anonymous Coward
      Anonymous Coward

      Re: And the Reg?

      Towards the bottom (bad) end of the list, I suspect - so many ads, some of them animated or trying to pop up in front of the text. Goes through phases depending on who's advertising at the time - seem to remember HP ads were awful a few months ago. Actually had a few genuine popup ads on the Reg a couple of days ago too - closed my browser and went to get my news elsewhere!

      1. Lionel Baden

        Re: And the Reg?

        El-Reg was the reason I got ABP, I dont mind adverts, just keep them responsible. It was when they started filling the entire background and you couldnt click on the sides to scroll down, that was when I got irritated enough to do something.

        Considering It's El-Reg they should think about offering a Ad-free version.

        1. Havin_it
          Boffin

          Re: And the Reg?

          >you couldnt click on the sides to scroll down

          Now this is the sort of thing that really gets my goat. Anything that interferes with the conventional and most basic methods of navigating around the page (arrow keys, mousewheel/touchpad scrolling, tabbing -- I've even had Home/End/PgUp/PgDn fucked with on occasion) is bad enough when the site's *own* webmonkeys do it, but when piped-in ads are responsible my contempt-o-meter crosses the red line. You come away with the feeling that they aren't all that bothered whether you actually, I dunno, *read* what's on the page or anything wacky like that.

          From a dev POV I won't even use jQuery if the efficiency gained doesn't justify the bloat added. Dear ghod, I'm glad they made it modular - if it was monolithic I think I'd never use it.

          For those hankering for an FF addon that profiles power usage, it's worth looking at YSlow (dependent on Firebug, which has a couple of its own profiling widgets to boot) as the reasons for a page loading slowly are oftentimes not entirely unrelated to the reasons for your computer shitting its lungs out of its ear in the process.

          (However it should be noted that those addons themselves, when activated, do exacerbate such problems a bit in their own right.)

    3. This post has been deleted by its author

  7. MJI Silver badge

    I watch task manager

    And see FF utilisation creep up.

    Anything over 1 oe 2 percent is dodgy.

    Seen 30% since they got multi core support.

    Start blocking and that drops.

  8. Anonymous Coward
    Mushroom

    I blame the current obsession with Single Page Web Applications, JQuery and image bombardment - all in the name of fancy design and efficiency. In reality, you have an irritating design that doesn't work on any platform, continuous loading from multiple JQuery scripts and a flat battery as the device goes mental trying to render it all. The amount of on the fly loads and calculations and ad pingbacks is just ridiculous. Kickstarter is another culprit and just kills the battery on my tablet.

    NoScript, Ad-Block and binning all browser plugins (especially fucking flash) is pretty much mandatory these days

    1. Simon Harris
      Joke

      "Kickstarter is another culprit and just kills the battery on my tablet."

      That's not actually the website killing the battery - it's a protection mechanism built into your tablet to power it down before you've had time find your credit card and blow a wad of money on some improbable project.

  9. Anonymous Coward
    Anonymous Coward

    I sympathise with batteries over NYT

    A lot of people die a little inside when exposed to the NYT.

  10. keithpeter Silver badge
    Coat

    A relevant blog post

    "I feel like someone just set up the entire vendor hall from an awful tech conference in my living room."

    http://blog.lmorchard.com/2015/07/22/the-verge-web-sucks/

    Link via another well known technical forum - the one with orange.

    The blog post author's use of web developer tools in Firefox coupled with the lightbeam extension have given me an idea for Maths teaching next year...

    The coat: quitting while I'm ahead, thanks all.

    1. Anonymous Coward
      Anonymous Coward

      Re: A relevant blog post

      @keithpeter

      Thanks for the linky, an excellent read.

  11. Elmer Phud

    Graun Groan

    The Grauniad site occasionaly moans at me for blocking ads.

    But, as with things like Facebook,, the only way to make these sites sensible is to block ads.

    Doesn't like Ghostery, either.

    1. Bloakey1

      Re: Graun Groan

      The worst site that I go on is the independent, the Grauniad is OK although it gets jolly batey about ad blockers.

      1. Havin_it

        @Bloakey1 Re: Graun Groan

        Frivolous upvote for using an adjective I've not read outside the pages of Tank Girl.

        Are you from Worthing too?

    2. captain veg Silver badge

      Re: Graun Groan

      Being an unreconstructed Opera 12 user, I take advantage of the built-in content blocker. The Graun site doesn't seem to know about that, or at least doesn't complain about it. But the latest redesign is a clusterfeck of the highest order in Opera on my 1024*600 netbook. You can't scroll to the bottom of the page without it spontaneously scrolling back up again, and it insists on stealing valuable screen height with worthless non-scrolling banners top and bottom. At least, that's how it used to be, until I tried turning off Javascript as an experiment. I left it switched off. The usability is improved by several orders of magnitude.

      -A.

  12. handle

    Ghostery

    No-one's (edit: one person has while reading the thread) mentioned Ghostery yet. Blocks these things without you having to spend 5 minutes on every page making decisions about what you want to enable. It blocks DataPoint Media, DoubleClick and Google Analytics on this page.

    1. Roq D. Kasba

      Re: Ghostery

      Ghostery is very useful, but their business model may surprise you.

      http://venturebeat.com/2012/07/31/ghostery-a-web-tracking-blocker-that-actually-helps-the-ad-industry/

      It's always a playoff between something being free and you being the something.

      1. Anonymous Coward
        Anonymous Coward

        Re: Ghostery

        @Roq D. Kasba

        Thanks for the link, but having read it, I'm in need of some kind person to explain it to me. It seems to me that it's saying that ad-promoters WANT to be blocked by Ghostery. And are paying Ghostery's creators to tell them that their ads are being blocked. Shurely shome mishtake? I must be misunderstanding summat somewhere.. - aren't I?

        1. Francis Boyle Silver badge

          Re: Ghostery

          From my reading of the article they're using the data to get a sense of where their ads are been displayed as in they don't trust the outfits that are selling them the space. Can't say I blame them on that score.

          1. Anonymous Coward
            Anonymous Coward

            Re: Ghostery

            @Roq D. Kasba - What's your point. This is explained in the Ghostery options and is opt-in.

        2. Anonymous Coward
          Anonymous Coward

          Re: Ghostery

          @Roq D. Kasba

          If it gives the ad and tracking reptiles an inkling of the degree to which they're blocked and where without spaffing user data it's probably a good thing, IF (a very big if) they correctly interpret the message and use it to consider how they can tone it down to the point the web is usable without a small software arsenal.

          I won't be holding my breath, since for me that means static ads (preferably text) with a reasonable (user not industry version) max ad/content ratio, properly policed for malware, no flash, with no tracking / beacons, no trading of user data, no clickbait or 'see also', etc etc. There probably is a way to make ads tolerable in at least a few contexts, and if this helps them understand the degree to which they are currently making things worse for themselves, then maybe some good comes out of it.

  13. Paul Shirley

    predictable but still surprisingly high

    The recent report of 3x average loading speedups by blocking all this sideloaded shit should have prepared me for this story but the amount of power being wasted is still shocking.

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

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

  16. 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!

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

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

  19. 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.)

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

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

  22. xybyrgy

    NYT Cost

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

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

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

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