Skip navigation

Tag Archives: performance

This was written April 1, 2012 and is not an April Fool’s joke. If you’re reading this years later for some reason, check to see if my reasoning still applies.

I walked into a CompUSA store to purchase myself a new machine with lots of cores for faster compilation of the Tritech Service System, among other things I do daily that require Linux and for which I didn’t have a decent home machine to work with. Ever since I got Netflix, my Toshiba Satellite P775-S7215 (arguably the best laptop I’ve ever used in my life, and certainly more than I ever paid for a laptop before) has been stuck in Windows 7 so that I can watch things while I work. It’s also nice to have the Windows GUI running for Internet use and document reading while plunking around in Linux on the compiling machine, which I have given the name “Beast” because…well, it’s a beast…but I digress. I walked into a CompUSA store, started tossing items into the shopping cart, and got to the CPUs, for which someone must help me since they’re behind a counter.

I asked what they had, and then said I was debating AMD vs. Intel. The employee behind the counter made the blanket statement, “Intel is always going to beat AMD.” I knew better, so I headed over to my favorite place to compare raw CPU performance, and started asking him for CPU prices and names. When PRICE was taken into account, AMD always beat Intel, rather than what he had told me, and he seemed as if he had lost a piece of his religion when I told him about it. There’s a serious problem in the computer hobbyist world where blanket statements are made and repeated ad infinitum regarding a variety of things, and this AMD vs. Intel performance debate is the worst of them all.

Before I explain why I say Intel loses to AMD on every price-to-performance ratio comparison, I’d like to mention another hardware experience that came before this which illustrates that skepticism and Google-Fu are extremely powerful tools. The WD20EARS 2TB 5900RPM SATA hard drives no longer have the excessive head unloading issue, which was a severe problem and very common cause of failure before even a single year of use was had in those particular Western Digital drives (and I believe some other early WD Green drives as well). I know this because I looked it up while staring at two of these drives I wanted, and reading that the issue was no longer present in the newer series of WD20EARS drives, and then purchasing them and using smarton montools in Linux to CHECK THE HEAD UNLOAD COUNT during a variety of usage scenarios. The count didn’t exceed 100 unloads within a week, and that put the issue to rest for me. (The approximate unload count needed for a drive to start failing is 300,000 and 100 in a week would take 3,000 weeks to reach that unload count.) I got two 2TB hard drives for $80 before the Thailand flooding happened, and I don’t have to worry about a manufacturer-caused premature failure occurring in them.

On to the meat of this discussion. My methodology is extremely simple. Go to a website such as Newegg, pull up CPUs that are the same price (or very nearly so), and compare the CPUs at cpubenchmark.net. If you’d like to give them some sort of price-to-performance score so you can perform comparisons across prices, you can divide the CPU benchmark score by the price, then multiply by 100 (since you’ll get LOTS of decimal places). Let’s see how this works out in real-world terms. As of April 1, 2012, the price of an AMD Phenom II X6 1045T processor at Newegg is $149.99, while the best Core i3 available at Newegg (the Core i3-2130 dual-core) is also $149.99. There are two other Core i3 CPUs at that price, but they are slower or are a first-generation i3, and anyone who is a savvy buyer will get the best bang for the buck, so those are being ignored. Why not an i5 or i7? Well, it’s not an apples-to-apples comparison when you put a Phenom II X6 against an i5 or i7, not because of some notion of “CPU generation,” but because you can’t even get a Core i5 desktop CPU at Newegg for less than $179.99, so there’s simply no i5 or better in the Phenom II X6 price range; also keep in mind that I’m justifying a personal purchase which fits personal budgetary concerns (mine was a 1035T for $130), and I put the price difference toward getting 16GB of RAM instead. If you have a higher budget, you’d need to compare against a better AMD CPU, which we’ll do in a minute. So if we perform the price-to-performance score calculation that I came up with earlier, what do we come up with for these CPUs? We’ll also compare the cheapest available i5, which on a price-to-performance scale is also beaten by the selected Phenom II X6.

AMD Phenom II X6 1045T Thuban 2.7GHz: 3355

Intel Core i3-2130 Sandy Bridge 3.4GHz: 2942

Intel Core i5-2300 Sandy Bridge 2.8GHz: 3130

So in terms of price-to-performance (which most of us refer to as “bang for the buck”) the AMD Phenom II X6 stomps both the i3 and i5 chips closest to its price. (Interestingly enough, we also see that the i5 is a much better value than the i3, both of which are the newer Sandy Bridge chips.) Let’s look at the new AMD FX chips that some of my friends have been raving about (and building gaming machines with) to see how they compare against the best possible Intel offering for the same price…

AMD FX-8120 Zambezi 3.1GHz ($189.99): 3743

Intel Core i5-2400 Sandy Bridge 3.1GHz ($189.99): 3222

The AMD FX chip pummels the Core i5 at the same price point, and even my Phenom II X6 fails to be “worth it” compared to the FX-8120. If I was not on a budget, I would have gone for the FX-8120 instead. Note how even though the i5-2400 is the best Intel chip in this comparison so far, it still scores 133 points lower than the Phenom II X6. Higher numbers mean more value for the price. Let’s do a few more comparisons against CPUs that I might be interested in if I was building a high-performance box with a higher budget, such as the awesome i7-2600K, just to see where the numbers fall.

Intel Core i7-2600K Sandy Bridge 3.4GHz ($324.99): 2799

Intel Core i7-3960X Extreme Edition Sandy Bridge-E 3.3GHz ($1049.99): 1342

AMD FX-8150 Zambezi 3.6GHz ($249.99): 3307

I’ve gathered all of these numbers into a chart to summarize the point of this article. I think the chart speaks for itself. I also invite you to do your own math and draw your own conclusions. Feel free to leave a comment as well!

I had a VM heap size of 48M set on my Motorola Triumph, with the rationale that the large amount of memory on the phone would be more useful if garbage collection was minimized through a high heap size. Unfortunately, it seems that my logic backfired. I tested every setting again and it turns out that the 16M heap size works wonderfully without triggering as much obvious garbage collection. Apps and startup are drastically faster. The irony is that the default heap size is 32M, but I achieve the best performance with the same default from the original G1 of 16M.

Update: it seems that some apps crash if the heap size is too low. My phone ended up needing a data wipe when I set it back to 16 at one point and this caused a soft boot loop. Be careful. Apparently, Android has a serious problem where its memory usage bloats over time. After a wipe, my phone ran faster than I ever remember, and the 32M heap size didn’t slow anything down. The moral of the story is simple: if you are running Android older than ICS (4.x) and the unit runs slowly, try backing up your data and starting over. I think that’s ridiculous, but it works.

IF THIS GUIDE HELPS YOU, PLEASE COMMENT. Last updated 2012-01-24.

[UPDATE: Added Android keyboard bug note; added step to remove ADWLauncher.]

[UPDATE 2: The launcher "Zeam" seems to be even lighter than LauncherPro.  Changing VM heap size to 12 and enabling JIT seems to improve the phone's AVERAGE behavior considerably. While slower than after the initial boot with VM heap size = 24 + no JIT, the latter combination seems to slowly degrade performance until a reboot is needed, while the new settings don't have such an effect. However, my phone is literally FULL with apps, so if you run lighter (i.e. remove Maps and Google Voice, don't have many apps) you may prefer the 24MB heap size.]

[UPDATE 3: You REALLY should perform the EzTerry 14MB RAM hack which makes a massive difference, but requires more advanced work and is beyond the scope of this tutorial.]

I managed to FINALLY get my T-Mobile G1 to perform very well while running Cyanogenmod 6 (specifically I’m running CM 6.1-RC1 for Dream/Sapphire), and because it’s been such a difficult and elusive process, and people all over the Cyanogen forums have been screaming about often lackluster T-Mobile G1 performance (due to the 96MB of OS-usable RAM installed in the G1) I should share everything I’ve done to get this far.

What’s so different about my performance as compared to others who report GOOD performance with a CM6 G1 is that mine had started to become quite poor, which is often the case with these phones and custom ROMs.  Everything would work great after a wipe+flash, which erases pretty much everything, and then over the course of a few weeks the performance would drop until it became laggy and very annoying.  Reports of dialer/phone appearance on an incoming call lagging so severely that calls would be missed are not uncommon.

How does it perform?  Well, most of the time the launcher doesn’t unload, meaning my icons appear immediately when I go “home.”  When it does unload, it’s very quick to come up.  Application load times are drastically better and there is no noticeable lag in most usage cases.  In particular, the 3D gallery, which is very notorious for being slow to come up when using the default CM6 settings, pops up in approximately 5-6 seconds, and all of my 150 or so pictures on my 4GB Class 4 microSD card pop up in another 4-5 seconds (the first gallery startup makes thumbnails and is significantly slower, but we can ignore that since it’s largely a one-shot deal.)

BIG FAT UGLY NOTE TO ALL G1 CYANOGENMOD USERS: The default CM6 Dream/Sapphire settings are NOT OPTIMAL FOR THE T-MOBILE G1!!! I will be telling you to change settings in the “Performance settings” which has a BIG WARNING when you open it about dragons and voided warranties. Don’t worry, you’ll be safe with my setting changes.

First and foremost, you need to get some apps from the Market.  Search for and install the following:

  • Zeam (smaller) or LauncherPro (nicer) to replace ADW.Launcher
  • Home Switcher for Froyo
  • ConnectBot (not strictly needed as you can use Terminal Emulator, but ConnectBot makes things easier)

Now we’re ready to clean up the software on the G1 and get it performing like it was meant to.  Follow these steps:

  1. Run Home Switcher and set the default home app to LauncherPro or Zeam.
  2. Hit Home to get into LauncherPro, then hit Menu > Preferences > Advanced Settings > Memory Usage Settings > Memory Usage Preset, and select Light.
  3. Home > Menu > Settings > CyanogenMod Settings > Performance Settings > OK > Compcache RAM usage > Disabled
  4. Uncheck the following:  Use JIT, Enable surface dithering, Lock home in memory.
  5. Check Lock messaging app in memory.
  6. VM heap size > 24m
  7. You have a G1, so you probably don’t need the on-screen keyboard, and it takes up at least 5MB of RAM even if you aren’t using it.  Decide whether you want to have the on-screen keyboard or if you want to be stuck with only the 5-row slide-out keyboard. For me, the choice was obvious because the on-screen keyboard really, really sucks, so I turned it off. If you can do without the on-screen keyboard (and I highly recommend this step) then deactivate it: Home > Menu > Settings > Language & Keyboard > uncheck Android Keyboard.  [UPDATE: Looks like this box checks itself automatically when you reboot. Just uncheck it whenever you reboot; it's probably a very minor bug in CM.]
  8. WARNING: the safe parts are now done and over with; in the next steps we will be stripping out Android apps that come with the CM6 system which can be sort of dangerous. Also, reflashing or upgrading CM will put these right back in place and you’ll need to repeat these steps.  (Apps exist to do these things more safely but I didn’t use them myself.)  If you are not comfortable with removing unnecessary system apps, stop here.  This page is very helpful reference for this: http://wiki.cyanogenmod.com/index.php?title=Barebones
  9. We need to remove Voice Search, Amazon MP3 (if applicable), Google Quick Search Box, and News and Weather. These apps seem to run themselves or a system service component all the time, and that means using memory unnecessarily.  (Plus, no one seems to use them anyway.)
  10. Run ConnectBot. Go through their tutorial if you like. Pay attention to how right-alt types a forward slash and right-shift performs “tab completion” of file names for you (in bash). These are very handy for typing the often long app file names. When you can open a new connection, change the connection type from “ssh” to “local” and hit [enter] in the empty box to the right of it.
  11. At the $ prompt, type su and hit enter. This will prompt for superuser access; allow the action to proceed. You’ll be changed to a # prompt.  Type bash and hit enter.  This will give you more junk before the # but otherwise it’s the same.  (Using bash gives us the handy tab completion, remember?)  Type the remaining steps in exactly as they are written, one per line.  If Amazon MP3 is not installed (on some versions) then the Amazon lines may return errors.  Note that after running any of the “pm uninstall” commands you will need to push the trackball button and then the letter “c” after you get “Success” to continue. For some reason it never seems to return to the command prompt if you don’t do this, but whatever.  Remember, you can hit right-shift to have the system complete the file names once you type enough characters.
  12. mount -o remount,rw /system
  13. rm -f /system/app/com.amazon.mp3.apk
  14. rm -f /system/app/GoogleQuickSearchBox.apk
  15. rm -f /system/app/GenieWidget.apk
  16. rm -f /system/app/VoiceSearch.apk
  17. pm uninstall com.amazon.mp3
  18. pm uninstall com.google.android.googlequicksearchbox
  19. pm uninstall com.google.android.apps.genie.geniewidget
  20. pm uninstall com.google.android.voicesearch
  21. [UPDATE] ADWLauncher apparently will continue to eat memory in the background even though you switched to LauncherPro.  Use the following command to make ADW go away (note you can reverse the process if you have to, or update/reflash):
  22. mv /system/app/ADWLauncher.apk /data/

[UPDATE: Don't remove ADWLauncher; if something goes wrong and you remove Zeam or LauncherPro, you'll have NO LAUNCHER and a reflash will be forced upon you. The 14MB hack will relieve some of the memory pressure and make this unnecessary anyway.]

Type “exit” three times to leave the console.  After all of this mess is completed, I’d suggest rebooting the phone to make sure everything is in a consistent state.  I noticed that lots of services run at initial startup, so don’t be alarmed if the G1 is slow for about a minute after the launcher appears.  I have found that deleting my Messaging threads and limiting them to 100 messages per contact significantly boosts Messaging app performance. Since Messaging is locked in memory, you might want to regularly clean it out to maintain optimal performance.  The same goes for the various Browser caches and saved information, though cleaning these will only make Browser perform better and has no effect on the entire phone.

After doing all of this, I noticed that my phone boots faster and is extremely responsive all of the time.  Even when the system reloads LauncherPro or starts an app from scratch, it’s MUCH faster to do so.  AGAIN, note that I am NOT using ANY of the following performance hacks:

  • Compcache (not even 10%, it’s DISABLED)
  • The Dalvik JIT compiler
  • Swap file on the SD card
  • 10MB RAM hack
  • Task/process killer applications (they’re unnecessary anyway)

Please leave a comment with feedback if you followed these directions.  I can’t provide help (that’s what the CM forums are for), I just want to know how it works for others.  Thanks!

Follow

Get every new post delivered to your Inbox.

Join 42 other followers

%d bloggers like this: