3 ms·
Bloated website code drains your smartphone's battery
- chris_wot 15y agoI believe there was an app for gtk+ that removed all nonessential parts of the library when you built custom apps... Maybe something like this is needed here?
- jws 15y agoTL;DR Something went wrong with this article's numbers and they may have used a very bad phone for testing. ("iPhone" appears early in the article, but that isn't the phone tested, it was an unnamed Android phone.) Simply loading the mobile version of Wikipedia over a 3G connection consumed just over 1 per cent of the phone's battery, while browsing to apple.com, which does not have a mobile version, used 1.4 per cent. That says, from a full charge, I can load 100 Wikipedia pages before exhausting the phone, or about 70 apple.com loads. In the interest of science I just loaded apple.com 70 times on an iPhone 4 and the battery indicator is still showing a full battery. The phone is working hard, I can feel it getting warm under the A4 processor, but I don't expect to charge today. The iPhone 4 battery is 1420mAh at 3.7V, we'll call that 18,000 joules. Later the article says wikipedia took 35 joules, and also that wikipedia takes 15 joules to load.[1] Those would imply 500 and 1200 wikipedia loads per battery charge. (Assuming their test phone had a similar battery to my phone.) I recommend ignoring this article until you see one with both consistent numbers, and a comparison of energy used for rendering and energy used for screen lighting and idling. Is render energy even relevant in real use? Can't tell from this. --- [1] It is possible this article is the work of an Electric Monk.
- pavel_lishin 15y ago> In the interest of science I just loaded apple.com 70 times on an iPhone 4 and the battery indicator is still showing a full battery. Did you clear the cache every time? Are you certain it's using the same amount of bandwidth each time?
- ams6110 15y agoAs commenter on the OP points out, this is a very isolated test, doesn't take into account that the "bloated" CSS and javascript downloads, while possibly not being used on the first page, are used in other pages on the site, and that during the overall session on the website, those files will be locally cached. Certainly doing what you can to minify downloads makes sense for any site, but serving up a separate minified CSS and JS for each page would likely perform worse than serving larger files once at the start of the session and then relying on the browser's cache.