ZH version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
25% Positive
Analyzed from 265 words in the discussion.
Trending Topics
#message#app#apps#battery#doing#outbound#notifications#doesn#whatsapp#usage

Discussion (5 Comments)Read Original on HackerNews
Whatsapp is #4 in battery usage on my phone, and has spent more time in background mode (9 minutes) than active (6 minutes.) Not nearly as bad as the author but I have to admit, I don't understand why it could spend anywhere near that much time doing anything. All it needs to do is be sent a new message.
Receiving a message in a timely manner, is far more energy-intensive, for two reasons:
- modern Internet, with nearly universal deployment of NAT, is such that any app (or phone OS, for that matter) can only make outbound connections. That is, to receive, it must keep making outbound requests to the server, constantly asking "is there a message for me?";
- modern android (and iOS too) has some pretty aggressive algorithms/rules to identify apps that can be safely suspended (i.e. denied the right to run in background). One such rule is "no activity within X amount of time". So, ironically, app has to waste CPU cycles to convince OS to keep it running.
There is an OS-level mechanism in both Android and iOS to avoid the second problem above, by the way of OS doing the polling (so-called "push notifications"), but there are their own dragons there, so many apps out out.
It's the low quality code from whatsapp and meta that's causing the battery usage doing all sorts of bad patterns like like constant outbound requests. So many apps like telegram don't have the same issues and are also just as responsive.
I got the same problems using Discord. It can take over 40% of a 4100mAh battery each day.