TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Optimizing performance on low-end Android devices

78 pointsby yinyinwuabout 10 years ago

3 comments

barrkelabout 10 years ago
It&#x27;s unfortunate that some of the recommendations here - particularly around reusing objects - are going to be out of date, and potentially deoptimizations, when Android gets smarter GC.<p>There&#x27;s a tension in platform optimization. Whether it&#x27;s CPUs or runtimes, people who make platforms tend to look at where they can get the biggest wins for existing apps. So if you bend over backwards to do weird things that get you performance, that weirdness will be exactly what prevents you from getting as big a potential win from future platform optimizations.<p>With GC in particular, that usually means avoiding the creation of objects that die in middle age. Most GCs are optimized for objects that are ephemeral or long-lived. Ephemeral objects have too few references and not long enough of a lifetime to survive multiple GCs. Long-lived objects live too long to be worth collecting for most GCs. Generational GC uses this to split memory into at least 3 logical buckets (survived 0 GCs, survived at least 1 GC, and long-lived).<p>Working hard to reuse objects means those objects will become part of the long-lived heap. But reusing them means updating their fields, including their references to other objects, which means they still need to be scanned. So they&#x27;ll increase the cost of what ought to be cheap GCs of the ephemeral objects; writes to them needs to be accounted, and they need to be included as roots.<p>The situation becomes even worse if you reuse an object for some time, but eventually find some of them surplus to requirements (the middle age problem).<p>The costs of designing an application to reuse objects are not to be sniffed at either. It&#x27;s a reinvention of a typed memory allocator, with all the benefits and drawbacks of manual allocation. Best kept to the implementation-side of properly scoped modules. Don&#x27;t let the approach pervasively infect the entire app.
评论 #9241742 未加载
评论 #9241189 未加载
评论 #9241149 未加载
评论 #9241715 未加载
tdklabout 10 years ago
I find it ironic seeing all those Google developer guidelines on how to be responsible with leaving Services running, but they leave their own crap running 24&#x2F;7 while you don&#x27;t even need to run the app.<p><a href="http://pastebin.com/AdUsUaG6" rel="nofollow">http:&#x2F;&#x2F;pastebin.com&#x2F;AdUsUaG6</a><p>Not to mention their last Google Play Services update that gets forced to all users automatically is causing wakelocks wanting to update the system, which wrecks havoc on custom ROMs : <a href="http://review.cyanogenmod.org/#/c/91021/" rel="nofollow">http:&#x2F;&#x2F;review.cyanogenmod.org&#x2F;#&#x2F;c&#x2F;91021&#x2F;</a><p>Google Android, thank you, not anymore.
评论 #9242057 未加载
xenadu02about 10 years ago
From another article on the site:<p>&quot;Can you ask for too many permissions? Short answer is no ... Our personal experience and that of other startups we’ve chatted with suggest any effect is overplayed. Just by browsing the Play store, you can easily find popular apps, including Facebook, WhatsApp, and Candy Crush, that ask for a lot of permissions. Most users scan the permission requests, and a list with 3 vs 5 permissions makes no difference.&quot;<p>Everything wrong with Android permissions in a single paragraph.<p>When security relies on users making good <i>secure</i> decisions, you&#x27;ve failed. If Internet Explorer taught us anything it&#x27;s that people will always click YES to punch the monkey, certificates&#x2F;sandboxes&#x2F;policies be damned.
评论 #9242451 未加载