[Galaxy Grand Duos i9082 General] iceyhotguy:
I've been playing around with a lot of settings, and these particularly made my phone smoother, faster, lag free and much more resposnsive despite the large amount of apps on my phone.

I tried to keep too much technical details out while covering the basic function of each attribute being altered :)

Tested on

: Stock 4.2.2, 4.2.2 based AOSP ROMs, 4.4.x based AOSP ROMs

What do you need :

1. Root Access

2. Busy Box

3. App - Performance Control by [MENTION=4674443]h0rn3t[/MENTION] - Original thread (check the download tab for apk) - http://xdaforums.com/showthread.php?t=2444376

4. Root Explorer like ES Explorer - https://play.google.com/store/apps/details?id=com.estrongs.android.pop

5. A little patience

WARNING

​

I have and am currently using these tweaks on my phone without any issues. So if your phone goes BOOM, tries to take over the world or tries to eat your brain, it's not my fault.
​

Performance Control Tweaks​

First of all, take screenshots of your default settings that you are going to alter. So if this doesn't work for you and you want to revert to original settings, you can do that on your own :p

1. Install the Performance Control application from above (or app with similar features)

NOTE: If you are on any custom ROM like PAC-MAN, the system might have it's own version of performance control (check Settings>Performance Control option). Follow these instructions to install the current one.

Download the latest apk from the above thread, rename it "PerformanceControl.apk"

Mount System. Copy the apk to /system/app and overwrite with the current application. Give it -rw-r--r-- permissions. Then Reboot. Done!

2. In Performance Control :

The first screen is CPU Settings, as shown I'm using interactive Governor with cfq I/O scheduler, after selecting them check the "Set on Boot" option.

NOTE: If you are on a custom kernel and you have SmartassV2 governor with CFQ or SIO I/O scheduler available, use that instead.

Interactive governor dynamically scales CPU clockspeed in response to the workload placed on the CPU by the user. Interactive is significantly more responsive than OnDemand, because it's faster at scaling to maximum frequency and therefore better for performance.

SmartassV2 is a rewrite of interactive governor with major tweaks that boost both battery and scaling of frequencies when performance is needed.

cfq I/O scheduler is basically for fair queing of processes, so it's better for multi-tasking in my opinion.

SIO I/O scheduler is a mix between noop and deadline but works with no reordering or sorting (downside) but still performs well.

View attachment 2313613​

The second screen is Memory Settings, please "Aggressive" or "Very Aggressive", screenshot there for reference if you want to set it manually, and check the "Set on Boot" option.

This handles how much memory is to be allocated and freed to and from the applications.

View attachment 2529544

Since 4.4 ROMs we have also been provided with the KSM feature in our kernel.

To enable this, simply click "Enable KSM" then Select "Settings".

Here you alter the pages to be scanned and the sleep time, i.e., how often should they be scanned.

I've found the following values to work well for me without compromising performance,

Pages to scan : 256

Sleep : 1500 ms

Once you have set the values, press "Apply Values", go back and check "Set on Boot"

KSM is a kernel thread that runs in the background and compares pages in memory that have been marked MADV_MERGEABLE by user-space. If two pages are found to be the same, the KSM thread merges them back as a single copy-on-write page of memory. KSM will save memory over time on a running system at the cost of CPU Power which can have an affect on battery life on long running devices.​

View attachment 2529545View attachment 2529546

For 4.4 ROMs running custom kernel, zRAM.

NOTE

: I am explaining this since it's a feature provided to us, but I do not recommend using it unless you keep running low on RAM.

To enable this, simply click on zRAM, configure the value in MBs (18%-25%), 200MB - 256 MB should be optimal. Then Click on Start.

In zRAM unnecessary/un-used storage resources/processes are compressed and then moved to a reserved area in the fixed RAM. This reserved area is referred to as zRAM and acts like a virtual swap area. This virtual space is what you configure in settings.

Advantage of using this feature is that it allows more RAM to stay free for use as well as keep apps and their data in standby mode so they are readily available when needed. This is very beneficial for low RAM devices is why it has been added to the official Kitkat.

However, the down-side of using this feature is that the compression (and de-compression) of data when it is stored away (or brought up for use) uses more CPU power and time. Which would mean, using this feature actively would probably reduce a little battery backup of your phone.
​

View attachment 2592112View attachment 2592113
​

The third screen is Advanced Settings, simply click on the SD read ahead option, and select 4096 (or 2048, lower value if you prefer) and check the "Set on Boot" option.

This is the read ahead speed for your internal and external memories. It helps your phone read any and all data faster while you are using it.

View attachment 2374893View attachment 2346266

Now we have VM Settings, please select each value and set it according to specific value (screenshots available for reference) and "Apply Values" to save the alterations after you are done editing, then check the "Set on Boot" option.

PLEASE NOTE : we are only editing these values :

vm.dirty_background_ratio : 70

vm.dirty_expire_centisecs : 500/1000

vm.dirty_ratio : 90

vm.dirty_writeback_centisecs : 1000/2000

vm.drop_caches : 3

vm.min_free_kbytes : 4096

vm.overcommit_ratio : 100

vm.swappiness : 20

vm.vfs_cache_pressure : 10

Each of settings is a direct tweak on how system and kernel handle the data.

Dirty Ratio and Dirty Background Ratio control how often the kernel writes data to disk

(Increasing these might decrease a little lag but might also affect negatively on performance, so skip these if you want to)

.

Dirty expire and writeback centisecs are used to define when dirty data is old enough to be eligible for writeout by the kernel flusher threads (higher values are supposed to decrease lag and increase battery by flushing data less often, again, might lower the AnTuTu score a little bit, so stick to the lower values if you want).

Drop caches : Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free. This will drop data sectors at each boot and let the kernel start caching as soon as the boot is complete.

1 => To free pagecache

2 => To free dentries and inodes

3 => To free pagecache, dentries and inodes

Minfree kbytes, like the name suggests, it's the minimum Kbs the system VM keeps free for each zone of memory

Overcommit Ratio allows the processes to allocate (but not use) more memory than is actually available

Swappiness is the tendency of a kernel to use physical memory instead of actual RAM, so you might want to keep this value around 20-30.

VFS Cache pressure is the file system cache pressure, so for faster operation we want the kernel to prefer RAM for this, so keep this value at 10-20

View attachment 2548359View attachment 2529529
​

Scroll to the last Screen, Tools. Here we have a lot of useful options that can be used for personal use, but we are mainly concerned with Optimize DBs option. Simply click Optimize Databases, it will ask you to confirm and take a minute or two to complete the command.

You can re-use this command every two weeks or so, since it's like de-fragmenting your phone's DB.

Use of this is, when a large amount of data is deleted from the database file (while being used by system or app) it leaves behind empty space, or free, unused database pages. This means the database file might be larger than necessary. Running VACUUM to rebuild the database reclaims this space and reduces the size of the database file. In other cases, database file becomes fragmented - where data for a single table or index is scattered around the database file. Running VACUUM ensures that each table and index is largely stored contiguously within the database file​

View attachment 2374936​

Build.prop Tweaks​

First of all, take a backup of your original build.prop before altering anything. So if this doesn't work for you and you want to revert to original settings, you can do that on your own :p

How to do it?

1. Install a Root Explorer. I'll be using ES Explorer.

2. Give it root permission to access the Root Explorer mode.

View attachment 2529422

3. Click the Root Explorer to get the following menu, and choose "MOUNT R/W" to mount /system partition in read/write mode.

View attachment 2529423View attachment 2529424

4. Navigate to /system folder to find build.prop

View attachment 2529425

Now you have two options, either Open and Edit it right there or copy build.prop to your PC and edit it using any utility like Notepad++.

If you use your PC to edit the file, you will have to copy and overwrite the original file with rw--r--r-- permissions (can be found by selecting build.prop in ES and selecting it's properties).

NOTE: /system will go back to Read only mode after each reboot, if you get any error unable to edit/copy build.prop you probably haven't mounted the /system partition as R/W.
​

NOTES : Please Read

1. All the tweaks that I am about to list have been available on XDA and several other sites. I am just listing the ones I found useful and have tested myself.

2: I'm using CM's default build.prop as reference. As each ROM's build.prop is different, please check if the developer has already added the tweak before adding it again. If the value or tweak is already present, you may edit it's value if you need to.

3: Add the new tweaks/lines at the end of the build.prop, so that you can easily find or remove them if needed.

4: You don't have to use all the tweaks, just the ones you feel you need.
​

The fun stuff

Lines that are not present in stock CM11 and can be added directly, are listed under TO-ADD.

Lines that are present but the values need to be edited are listed under TO-CHANGE

Lines that start with #DONTCOPY are for your information purposes only, and ofcourse don't need to copy them.

'#' - Hash Tags are used as comments in build.prop for sorting purposes, so even if you copy the # line, it will not give you any errors.

TO-CHANGE

#For Dalvik App performance

dalvik.vm.heapstartsize=8m

dalvik.vm.heapgrowthlimit=64m

dalvik.vm.heapsize=256m

​

TO-ADD

# Camera and Video Tweaks

ro.media.enc.jpeg.quality=100

ro.media.dec.jpeg.memcap=8000000

ro.media.enc.hprof.vid.bps=8000000

ro.media.capture.fast.fps=4

ro.media.capture.slow.fps=120

ro.camcorder.videoModes=true

ro.media.panorama.defres=3264x1840

ro.media.panorama.frameres=1280x720

# Camera and Video Flash Tweaks

ro.media.capture.flashMinV=3300000

ro.media.capture.torchIntensity=40

ro.media.capture.flashIntensity=70

# Disable Sending Usage Data

ro.config.nocheckin=1

# Enable sensor sleep

ro.ril.sensor.sleep.control=1

# EGL debug for system performance

debug.egl.hw=1

debug.egl.profiler=1

# Frees More RAM

persist.sys.purgeable_assets=1

# Incoming and Outgoing Call Tweaks

ro.telephony.call_ring.delay=0

ring.delay=0

# Increase Responsiveness

windowsmgr.max_events_per_sec=140

video.accelerate.hw=1

# Increase Performance

debug.performance.tuning=1

# Media Tweaks

media.stagefright.enable-player=true

media.stagefright.enable-meta=true

media.stagefright.enable-scan=true

media.stagefright.enable-http=true

media.stagefright.enable-rtsp=true

media.stagefright.enable-record=true

# Net Speed Tweaks

net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960

net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960

net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960

net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960

net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960

net.tcp.buffersize.hspa=4096,87380,256960,4096,16384,256960

#DONTCOPY there's no space between any number here, but XDA is displaying it anyway. please remove it while copying into build.prop

# Pointer duration optimize for better scrolling

ro.min_pointer_dur=8

# Power saving

ro.ril.power.collapse=1

pm.sleep_mode=1

#DONTCOPY pm.sleep_mode=1 -> collapse - will totally power off the cpu

#DONTCOPY pm.sleep_mode=2 -> sleep - cpu is still on, but put into low power mode

# Proximity Sensor responsiveness during Calls

ro.lge.proximity.delay=25

mot.proximity.delay=25

# Signal Reception Tweaks

persist.cust.tel.eons=1

ro.config.hw_fast_dormancy=1

# Scrolling Tweak

ro.max.fling_velocity=12000

ro.min.fling_velocity=8000

# HW debug and Persist SystemUI HW

debug.sf.hw=1

persist.sys.ui.hw=1

# WiFi to Scan Less Frequently

wifi.supplicant_scan_interval=180
​

Let me know if it worked for you :)

If any member has any other sysctl, VM or build.prop tweak that I might have missed or a setting value that works better for them, please let me know. I would be happy to test and post here :)