Swap Size Benchmark Comparison

smokenbiskits

Active member
Apr 11, 2011
39
6
0
Visit site
So I used aospCM7-VM-20110516 and tried different swap/FS sizes.
The reason I did this is because I received a lot of hear-say about swap/fs sizes. I like numbers to do the talking; I'm a Computer Engineer in training so I love proof by numbers.
My hypothesis was swap size did matter, greater than 5% difference.

All Quadrant runs were in airplane mode on 768/768MHz cpu speed.
A good amount of the difference in averages represent less than a 1% difference, which is within the margin of error.


QuadrantvsSwap_html_m7cc82b7a.jpg


BenchmarkSwapQuadrant.png


Story of the numbers: swap doesn't matter!

Of course that's what everyone said, but I just hate to be told something be given no proof.
Experiments conclude that swap size's effect on benchmarking is negligible. :D
 
Last edited:

zedorda

Well-known member
Mar 16, 2011
2,594
178
0
Visit site
Heres a clear point to make this easier to understand. LG OPTIMUS V DOES NOT USE SWAP. Its nowhere in any of the code within its firmware. I think there hasnt been a phone to use swap memory since they avg over 128mb base.

P.S. From what I hear from a group I will refer to as "elders" in this field say "The swap file issue is talked about in circles that don't know whats going on but like to sound smart talking as if they did". This isn't a reference to you but to those you may of heard the hear-say from.
 
Last edited:
Feb 19, 2011
1,971
284
0
Visit site
that sounded mean.
I would say instead that the kernel used in the aospCmod ROMs has swap disabled in the build config. So, any app claiming swap isn't really using it, there is some kind of substitute for swap going on.
I'd love to have that kernel compiled with swap and ufs support if you're into that kind of thing and happen to have a swap-enabled kernel.
 

zedorda

Well-known member
Mar 16, 2011
2,594
178
0
Visit site
I am sorry I wasn't trying to be mean. I am just really bad at coming off nice but please believe me I wasn't trying to be mean :)

The reason swap fell out of favor is connected to the only reason it was being used at all was the need for more memory and the cost (at the time the memory was more costly than now). Now technology has advanced to the point that the on board is faster in most cases than the SD card where before SD cards could be faster. So back in the day u could use the swap and see real increase in performance. Now ur more likely gonna see a reduction unless ur using a real fast SD card. Hence the reason there are also groups of people still around that likely learned of and used swap bc a friend or a forum suggestion. They don't really know why it made their phone faster so they apply it to every phone they get their hands on. Not knowing "why" they then make their newer (not needing it) phone perform crappier.

This same thing happen with ReadyBoost for Windows Vista. ReadyBoost was made and only intended for systems with 1gb or less RAM to help Vista run smoother. But there are forums with posts leading people to seek out fast usb flash drives shelling out money for stuff that will never help them since they are alrdy running a system with 8gb DDR3.

Windows 7 has a slightly different implementation of ReadyBoost than Vista.
 

obijohn

Well-known member
Mar 31, 2011
169
100
0
Visit site
Swap is disabled in all the kernels on the V. Well, it is disabled in Bumblebee and xionia (used in aospCMod and lots of other roms), I believe it is disabled in picasticks as well but it's been a while since I checked his .config. mkswap and swapon/off are (probably) there, and may even function, but the kernel won't use the swap.

I am releasing a new build of the Bumblebee kernel in a couple of days because I've made a few minor kernel tweaks, and if you'd like I can build a version with swap enabled for you so you can do the tests again. Just let me know.

zedorda is right about the memory thing, though. The reason swap became important early on in Android roms was that those first couple of phone had very little free ram and could hardly hold the contents of a web page in memory when going from the browser to the home screen and back (which meant that every time you re-opened the browser it had to reload the page it was on -- very annoying). My G1 back in the day had something less than 10MB of available ram after bootup. I am not kidding. Pathetic. The V, however, has between 200-250MB or more free on boot depending on the rom. So even if you created swap, it would hardly, if ever, get used.

Also, when/if you do this test again, you need a better benchmark. Quadrant scores aren't going to tell you anything about the efficiency of swap space, unless you can figure out a way to run it with so little free ram available that when Quadrant does it's memory i/o test it will be writing to swap instead of ram.
 

smokenbiskits

Active member
Apr 11, 2011
39
6
0
Visit site
Reply for benchmarking on swap

Thanks for the apology Zedorda.
- It would've been different if someone showed specifically in the code where it's disabled, but no one does. They tell you, and I am not one to believe everything I hear. Be thankful that now there's even more proof that enabled or not it doesn't really matter.

Thanks squid for the backup :D

Obijohn
- What do you suggest I use to compliment this type, or any type of benchmarking? In computer based benching there are well established programs to use i.e. PCmark, 7zip, various games w/ built in benchmarks. I also only used one "overall" benchmark to save time. I spent nearly 3 weeks getting to the point where I felt comfortable with the way I Benchmarked the ROMs for comparison. I'd love to hear any constructive criticism.

I want Android to succeed, and I also want the best performance for the buck. If testing swap or benching different ROMs is what it takes I don't mind doing. Computer's are my passion (FSU student for Computer Engineering), and I've always read benchmarks as a great comparison all other things being equal. Love you guys :-*
 

obijohn

Well-known member
Mar 31, 2011
169
100
0
Visit site
Thanks for the apology Zedorda.
- It would've been different if someone showed specifically in the code where it's disabled, but no one does. They tell you, and I am not one to believe everything I hear. Be thankful that now there's even more proof that enabled or not it doesn't really matter.
It's in the kernel .config file which specifies how the kernel is to be built. For most (new) android kernels the line in questions is this:
Code:
# CONFIG_SWAP is not set

I'll have a swap-enabled kernel for you to play around with in a day or two.

Obijohn
- What do you suggest I use to compliment this type, or any type of benchmarking? In computer based benching there are well established programs to use i.e. PCmark, 7zip, various games w/ built in benchmarks. I also only used one "overall" benchmark to save time. I spent nearly 3 weeks getting to the point where I felt comfortable with the way I Benchmarked the ROMs for comparison. I'd love to hear any constructive criticism.

I want Android to succeed, and I also want the best performance for the buck. If testing swap or benching different ROMs is what it takes I don't mind doing. Computer's are my passion (FSU student for Computer Engineering), and I've always read benchmarks as a great comparison all other things being equal. Love you guys :-*

Yes, there are several well-established benchmarks, but none that I know of for benchmarking swap. The reason is that if the ram is not full, swap won't be used. If it's full, only swap will be used. If it's mostly full, some ram will be used and some swap, but there's no way for the benchmarking tool to tell you. So really the only way to test it is to fill up the ram completely so that any memory reads/writes will be to swap. Probably the best benchmark is comparing disk i/o on the swap partition to memory i/o with swap disabled. But unless your sdcard is class 10, it won't even be close.

For straight Android on the V, there's about 200-250MB of available ram after boot. It's almost impossible to load so many programs that ram fills up completely, because when available ram starts to get low, android will automatically start killing programs that are just sitting in the background to free more ram. Now if you've got debian running on the phone (booted, not just a chroot image), that's completely different. I imagine that doing some big compiles, like say emacs, would use up at least 250MB of ram. But then again, you'd have more free ram with debian because you wouldn't have all the android stuff running.
 

smokenbiskits

Active member
Apr 11, 2011
39
6
0
Visit site
I await the ROM w/ swap enabled...
maybe I can devise a way to fill up memory...
autokiller let's me set minimums for Droid to start exiting out of programs.

I'll try to see what I can do w/ that to fill up RAM...thanks for the quotes from config file

That is what I wanted to see, although I still would've benchmarked. The best experiments are the ones not only the ones that explore but also the ones that confirm.
 
Feb 19, 2011
1,971
284
0
Visit site
...Now if you've got debian running on the phone (booted, not just a chroot image), that's completely different. I imagine that doing some big compiles, like say emacs, would use up at least 250MB of ram. But then again, you'd have more free ram with debian because you wouldn't have all the android stuff running.

even a chroot eats up all the RAM on big compiles. compiling chromium-browser causes gcc to be whacked by android's oom-killer consistently, every time.
if I had Debian actually booting, it would run at least as many background services as android does. it just has a more tolerant oom-killer in the straight Debian kernel I think.

looking forward to that swap-enabled kernel!
 

smokenbiskits

Active member
Apr 11, 2011
39
6
0
Visit site
So I was reading and a problem with swap could be confidential info generally kept in memory could be stored in swap...no bueno

Sent from my LG-VM670 using Tapatalk