How To Reduce Game Lags On Nexus 7 And Other Devices
- So, I was experiencing significant lag as we all do from time to time, and decided I was going to get to the bottom of it.
- After tracing and debugging for hours, I discovered the source of 90% of Android’s lag. In a word, entropy (or lack thereof).
- Google’s JVM, like Sun’s, reads from /dev/random. For all random data. Yes, the /dev/random that uses a very limited entropy pool.
- Random data is used for all kinds of stuff.. UUID generation, session keys, SSL.. when we run out of entropy, the process blocks. That manifests itself as lag. The process cannot continue until the kernel generates more high quality random data.
- So, I cross-compiled rngd, and used it to feed /dev/urandom into /dev/random at 1 second intervals.
This Stuff Really works and you can play games incredibly fast and responsive on nexus 7 or any other device.Rejoice Gamers..
- There is a (theoretical) security risk, in that seeding /dev/random with /dev/urandom decreases the quality of the random data. In practice, the odds of this being cryptographically exploited are far lower than the odds of someone attacking the OS itself (a much simpler challenge).
- This may adversely affect battery life, since it wakes every second. It does not hold a wakelock, so it shouldn’t have a big impact, but let me know if you think it’s causing problems. I can add a blocking read to the code so that it only executes while the screen is on. On the other hand, many of us attribute lag to lacking CPU power. Since this hack eliminates almost all lag, there is less of a need to overclock, potentially reducing battery consumption.
From sister site: www.droidwick.blogspot.com

























