[Sony Xperia P, U, Sola, Go] mrsatan:
Since I keep getting msgs from people asking me how I have optimized my Xperia S for less lag and such, I thought I would make a thread teaching others all I know. First a little background info.

I have used a HTC Hero for 3 years before I got this phone, so I know a few things about optimizing and getting the most out of old hardware. This means that I am quite versed in memory management, deleting unneeded apks and proper overclocking for maximum effect and battery life. I hope to install my knowledge upon others so we can stop getting noob threads like "I have less than 1gb of ram" or "ICS lags so I am going back to gingerbread, you suck Sony!".

Before we start, if you have used any of the older kernels with old CWM versions, those versions of CWM can bork your data or system. This leads to root issues, apps still showing after clearing, unable to mount partitions in CWM and any other number of issues. To fix this i recommend flashing a stock Sony ICS firmware, then fastbooting the latest version of Advanced Stock Kernel. This will give you a nice clean slate to work with. Also you can make a backup of stock firmware to roll back to if you have problems.

Now off to the races.

Build.prop tweaks

there are plenty of build prop tweaks out there, but here are the ones i use. I will continue to update this list as I try new stuff

davlik.vm.execution-mode=int:jit

dalvik.vm.heapsize=110m

ro.max.fling_velocity=150000

ro.min.fling_velocity=80000

ro.semc.batt.capacity=1750

ro.telephony.call_ring.delay=0

view.scroll_friction=0.01

windowsmgr.max_events_per_sec=250

Systcl Tweaks

Coming soon.

Memory Management/Free Ram - Many many people complaining about free RAM just don't understand how it works. In any efficient modern OS (Windows 7, ICS) free ram is wasted ram. I theory you should be using your free space to preload resources you might possibly be needing or using them to run a variety of apps and such. The only time where you would really need a large amount of free RAM would be when you want to play a game/ use an app which requires a larger amount of memory than is normally required. Sometimes Android will have a problem freeing up this required space which can lead to lag/freezing or even a reboot. If you don't play a ton of games, then don't worry about having a ton of free RAM. Secondly, more lag is created by the OS needing to resart an app or service (ie Home launcher) than if it needs to kill an app to free RAM. This is why you get Home redraws which lag for a split second, because the OS has killed off the home and it is restarting it. So less free RAM generally means less lag.

PS. Android takes up space for the system and this space is not shown on the ram usage screen. This means that if you have a device that says 1gb of RAM, the free RAM may show only 600mb. Don't freak out, this is normal all devices have it though it varies depending on skinned versions of android and which android version it is using (ie ICS uses more ram than previous versions).

How to fix Android Memory Management - Android memory management has made massive steps forward from how terrible it used to be, but it is still not optimal to say the least. We can help fix this by running a script by our not so friendly XDA member Zepplinrox.

http://xdaforums.com/showthread.php?t=991276

Go to this link and read everything that you can comprehend before reading my explanation. This can be tricky and can force bootloops so make sure you back up with Nandroid.

Step Zero - Get script manager off the market. Run as root

Step One - Download the kit and the latest Supercharger Script

Step Two - Run the kit, generally on the ROMS i have tried at least, you dont need to install a new busybox or root version so skip those.

Step Three - Run the auto mode in the script or Download the automatic patcher which patches your smali files and pushes over the new services jar required for locking the home in memory. (alternatively you can do it the hard way with the smali patcher script but I dont recommend it)

Step Four - Run the script and read through things. It should make sense but ask me if you need help.

Step Five - Clean and Reboot. Sometimes it can freeze on first boot, hold vol up and power to restart. This latest script is still in testing so you may have issues but it is certainly better than the original setup.

I love the Sh1t out of supercharging and have used it for years.

Supercharging is really easy on KA17 as the services.jar is already ready to go. Just run the script which fixes oom memory settings and you are done. Dont forget to clean and reboot.

Follow-up- Run a flush engine option in the script which will then create a quick launch script in V6 supercharger directory. Put this on a schedule to run every few hours and you wont have to worry about rebooting your phone as much. Run it as superuser.

Want even less lag? - Delete any unneeded apk files either with a root explorer or Titanium Backup. This way you wont have apps you dont use fighting for memory and cpu. I delete powersaver and the exchange client as I dont use either. Other roms may have much more.

Kernel - Your kernel and kernel settings will make a huge difference in the feel of the device. I recommend XSX v6 (doesnt have crappy CWM). Set it to 1876-30 hotplug and try things out. Not every chip is the same so they all wont run great. My Hero hated the max frequencies, but my Xperia S will take all the way up to 1900 just fine. Choose a scheduler, I use deadline, but CFQ or noop are good too.