Will Pyra get benefits from zram?


Ted

Member
Joined
May 2, 2016
Messages
101
Location
Beijing, China
On old laptop with only 2GB memory, enable the zram can slightly improve the experience, slighy better than swap, as the mechanical hard drive caused slow swap.
For Pyra, which is better, zram or swap?

Sent from my SM-G900F using Tapatalk
 
Trading of cpu power against more ram is probably the last thing you want to do on a mobile device.
Zram is nice for a few mb more or when the program is shitty coded, eg. saving uncompressed bmp files to ram, but once you have real world data it can slow things down to a point where crashing is the better solution.
Besides, you should not have swap unless you really know what you need it for, so if it does not crash, dont bother about it.
 
IIRC the Pandora was set up to use half of the RAM as zram swap at one point in its history, but the benefit obtained wasn't obvious - well written stuff will limit its RAM usage, and heavy stuff is just better off using proper SWAP to flash storage most of the time.
 
Using compression on items stored in RAM has advantages when the CPU is relatively fast, the RAM size is relatively small and the storage is relatively slow. Think 80286 with 1MB of RAM running 1.2MB worth of software on/from a 1.44 MB floppy drive.

The Pyra has a relatively slow CPU, relatively large RAM size and the storage is relatively fast. So, not a great fit for RAM compression.
 
Trading of cpu power against more ram is probably the last thing you want to do on a mobile device.
You're blowing things out of proportion. The kind of algorithms used for this are way too simple and fast to really cause a noticeable impact, even on the Pandora. The same kind of compression is a common trick used by SSD controllers to make the drive even faster as you save more bandwidth than you lose time through compression - those controllers are commonly implemented using Cortex-M cores. Works really well with filesystem-provided compression on HDDs as well - compressing SSD controllers don't like compressing compressed data, though.
 
This thread reminds me of an old fantasy that i could run Wolfenstein off a floppy drive. It would stop and buffer stream loads of data on turning particular corners or when bosses appeared. Probably the most masochistic way to play an fps, but i'm fairly sure other people were obsessed with this; the engine for GTA San Andread streams masses of data without lagging, at floppy type rates. Xbox port uses brute force perhaps, but the Android version was like playing floppy Wolfenstein again, ha.
 
Thanfully, our experiences of using zram on Pandora were nowhere near as dramatic as that. Most of us didn't even notice it has changed, but Notaz did some testing and I think discovered that performance was slightly worse in letting apps use that extra ram, so he switched if off again for the next update.
 
There might be a benefit for single-threaded stuff, where the second core otherwise idles, but I don't know whether or not it would be worth the extra thermal load then.
 
Back
Top