5,593,293 Members 33,473 Now Online
XDA Developers Android and Mobile Development Forum

[UTIL][OUTDATED] One Click Lag Fix 2.0

Tip us?
 
RyanZA
Old
(Last edited by RyanZA; 16th September 2010 at 08:59 PM.)
#1  
Senior Member - OP
Thanks Meter 726
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Default [UTIL][OUTDATED] One Click Lag Fix 2.0

This version is now deprecated in favor of the 2.0 APK version. Please see this link: http://forum.xda-developers.com/showthread.php?t=784691

This version is not recommended for use any longer.

Details about what this fix does:

Creates a VIRTUAL EXT2 filesystem inside the stock RFS filesystem on the internal SD card, with a 4KB block size. This means that this lag fix creates a buffer between the real filesystem and the android system. This buffer should reduce the amount of disk I/O required for all operations by utilizing EXT2 buffering, as well as not writing file access times to disk, etc.

Folders that are currently supported:

/data/data
/data/system
/data/dalvik-cache
/data/app
/data/app-private as a symlink to /data/app/app-private

/dbdata/databases is not supported. It appears to be ROM backed, and can cause problems if overwritten.

Benefits over version 1

1.5GB of application data available, with no data loss.
e2fsck of the EXT2 partition on each boot.
Correct busybox version included! YES!
/app and /app-private directory included in the fix for faster application installs.
/dbdata/databases included in the fix, expected to give a big performance boost for apps that use it.
Mounts instead of symlinks for extra performance as OS does less work (about 100 or so more quadrant).

Benefits over other lag fixes

Open source, with full comments and ease of editing.
Works on any and all firmware versions, including any yet unreleased froyo versions (that don't change file structure).

Credits
Big thanks to mimocan for putting us all on the right track in how to sort out lag problems!
Big thanks to ykk_five for showing us all how well loopback filesystem mounting works!
Big thanks to cyanogen mod for e2fsck

Requirements for One Click Lag Fix 2.0

Rooted phone - http://www.addictivetips.com/mobile/...-single-click/
Windows computer with SGS Drivers (Samsung Kies), or the ability to read through the batch file and run it yourself.
(Beta Release) The ability to reflash your device if something goes wrong.
No other lag fix installed. If you installed One Click Lag Fix 1.0, then use the uninstall function which came with that lag fix before running this lag fix. (Untested but assumed to be working, please help out here.)
1.5GB of freespace on Internal SD Card for swap files while the fix is working (/sdcard).
"Internal phone storage" in Settings->SD Card must read greater than 500mb (0.5GB) of free space.

How to run One Click Lag Fix 2.0

Place your phone into USB debugging mode: Settings->Applications->Development
Attach your device to your computer. Do not mount the drives.
Download the attached ZIP file.
Unzip to a folder of your choice.
Double click "lagfixme.bat".
Don't double click "unlagfixme.bat".
Wait for it to complete.
You will need your phone to be unlocked when it runs the script, so that you can accept the permissions request that will appear on your device.

How to remove One Click Lag Fix 2.0

Double click "unlagfixme.bat"
Wait for it to complete.

Known Issues For All Versions

Some custom firmwares use up all available space in /system. This fix requires some libraries to be placed in /system/lib. These libraries are used to create the filesystem properly, and to check it for errors on every boot.
If your firmware does not have the available space (around 1mb) in /system, do not use this fix! Your phone will not boot and will have to be restored from backup / reflashed.
Current known firmwares with this issue: None yet. Please provide the firmware version+mods if you encounter this issue. It will show up as an out of space error in the log, under 'Copying libraries'.

Known Issues 2-1, 2-2

Paid apps from the market have issues.
Google maps and other pre-installed ROM-backed applications have issues.

2-3 Changes from 2-2

/dbdata has been removed. This fixes maps issues.
/app-private is now a symlink to /app/app-private. This fixes paid apps issues.

Alternate installation methods for similar fixes

Tayutama has made an update.zip version that is easy to install - http://forum.xda-developers.com/show...&postcount=208
Chainfire has a .NET version of this fix with some nice features - http://forum.xda-developers.com/showthread.php?t=751513
Attached Files
File Type: zip RyanZAEXT2LagFix BETA 2-2.zip - [Click for QR Code] (1.45 MB, 4154 views)
File Type: zip RyanZAEXT2LagFix BETA 2-3.zip - [Click for QR Code] (1.45 MB, 16806 views)
The Following User Says Thank You to RyanZA For This Useful Post: [ Click to Expand ]
 
RyanZA
Old
(Last edited by RyanZA; 18th August 2010 at 10:52 PM.)
#2  
Senior Member - OP
Thanks Meter 726
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Frequently Asked Questions

Q: My apps are force closing while this fix is running, and I can't use my phone!
A: By design. The script has backed up/copied your apps over to the internal SD card (remember the requirement about 1.5GB of free space on the SD card?). It is now overwriting them with a 1.5GB file. As the file overwrites an app that is trying to do something, it will probably force close. This is normal.
Closing all running apps, and removing widgets before running this fix can make the process much smoother, though.

Q: The script can't transfer files to my phone / The script can't run / Help help I'm dieing!
A: Read the first post again.

Q: My paid apps from the market don't show up.
A: I will hopefully have a fix for this sooner or later. Hold tight! It's in the known issues. I don't have access to paid apps, so I can't test this.

Q: Does this need busybox?
A: No, busybox is included.

Q: I only have 200mb of free space now! What gives?
A: The lag fix has made a 1.5GB file, and is storing all of the data inside there. The side effect is that the free space meter is now incorrect. Sorry, this can't be helped.
You can check real free space by using ADB like this:
Code:
adb shell
su
busybox df -h
Q: When I use a backup tool, the backup is now 1.5GB big! It's taking forever!
A: The backup tool isn't designed to work with this fix. It will work, it just won't work well. Hopefully this fix will be short lived, and either Samsung will give us a new update, or someone will give us a good custom firmware that can natively mount what we need, where we need it. Or someone might come out with a better backup manager. Until then, we suffer.

Q: Will a reflash wipe this fix?
A: Yes, a reflash will wipe everything this fix did.

Q: Can this brick my phone?
A: If you know how to get to the download mode from power off (hint: volumedown+home+power), then almost nothing short of throwing your phone off a tall building can actually brick it. If you can't do this though, or don't know someone who can, then you're better off waiting for samsung to release a fix. Anything that moves files around on your device has the potential to break things, and this fix has no QA department.

Q: Why is /dbdata not included in your fix, but other people have included it?
A: Other people have included it in the same way my 2-2 fix includes it. However, /dbdata is ROM backed. This means that the real files are on ROM, and only the changes appear in the /dbdata folder. When copying or moving files from this folder, you would need to specify each folder by exact name to ensure that it was copied across, and each firmware can have their own names. (This is because RFS wildcard will not catch an unused ROM backed file.) In some cases, you can get lucky and have this work perfectly because you have already used all the files in /dbdata. There is no fail safe method to do this though, and /dbdata does not make a big difference to performance. (It is already on NAND flash.) If you want to try your luck, v2-2 is still available.

Q: Why does this lag fix work? Is it slowly destroying my phone?
A: Let's say an application counts from 1 to 10, and writes the value each time to disk.

Stock:
1 -> App tells RFS to write 1 to disk -> RFS writes 1 to disk -> RFS writes journal saying to changed the value on the disk.
2 -> App tells RFS to write 2 to disk -> RFS writes 2 to disk -> RFS writes journal saying to changed the value on the disk.
..
9 -> App tells RFS to write 9 to disk -> RFS writes 9 to disk -> RFS writes journal saying to changed the value on the disk.
10 -> App tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

Total physical disk writes: 20. Speed: SLOW! Wear and tear on disk: HIGH!

Lag Fix:
1 -> App tells EXT2 to write 1 to disk -> EXT2 stores 1 in RAM.
2 -> App tells EXT2 to write 2 to disk -> EXT2 stores 2 in RAM.
..
9 -> App tells EXT2 to write 9 to disk -> EXT2 stores 9 in RAM.
10 -> App tells EXT2 to write 10 to disk -> EXT2 stores 10 in RAM.
..
EXT2 tells RFS to write 10 to disk -> RFS writes 10 to disk -> RFS writes journal saying it changed the value on the disk.

Total physical disk writes: 2. Speed: FAST! Wear and tear on disk: LOW!

This isn't exactly what is happening, but it gives you the general idea.

Q: Can this mod work on other Android devices? Would we see a performance boost on them as well? If not why is it limited to the Galaxy S?
A: SGS has very very good hardware, but it has some parts of it's hardware poorly implemented. The filesystem that samsung chose to use is custom-built using FAT32 as a base, RFS. It has a lot of the problems that FAT32 has, and should have been left back in the 90s, or even the 80s.

One of the big issues with it is how it handles multiple requests - it blocks. It blocks everything. When your mail app wants to read the mail you just tried to view, but your twitter app is busy writing a new tweat it just received, your mail app is forced to wait.

This is bad, but it could be worse! And it is... your twitter app didn't just get one tweat, it got 50 tweaks. It is busy writing the tweats one by one to the filesystem. This would be fine, since all modern filesystems will buffer writes, so instead of writing each one at a time, they will batch them together and write it as a big chunk. Uh oh - RFS does no buffering at all! After each write, it will also write an update to the grafted-on journal system. Guess what happened to your mail you were trying to view while all this happened? It 'lagged' and you got a black screen for half a second, before the mail popped into view.

Luckily the hardware on the device is so good that you usually don't even notice the problem until you have a lot of apps running, all writing their updates when you unlock the phone.

This is mostly speculation based on experiments done on RFS -- RFS is closed source, and we have no idea if the problems are just badly set settings (such as a block size that is too small), coding bugs in the implementation, or if RFS is just really that badly designed.

This fix just grafts a buffer on top of the RFS filesystem, using a very very simple and fast filesystem, EXT2. It fixes most of the issues by writing to RFS as seldom as possible.

So no, this fix won't fix other devices, since they're already running quite close to maximum speed. The SGS at stock is running nowhere near maximum speed, and this lag fix takes it a bit closer. You could probably speed up other devices by tweaking the filesystem settings to give them a big buffer or similar, but it isn't really needed. (I haven't actually tried to put an EXT2 onto any other Android phone, as I don't have any other Android phone, so this is just speculation.)

Q: My phone is fast now!
A: Yeah.
The Following User Says Thank You to RyanZA For This Useful Post: [ Click to Expand ]
 
RyanZA
Old
#3  
Senior Member - OP
Thanks Meter 726
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Oh, awesome. I managed to post this in the wrong forum. Doh!

Could a moderator please move this to Android Dev sub forum?
 
MAMBO04
Old
(Last edited by MAMBO04; 11th August 2010 at 10:57 PM.)
#4  
MAMBO04's Avatar
Recognized Developer
Thanks Meter 890
Posts: 1,565
Join Date: Jan 2009
Location: Brighton

 
DONATE TO ME
haha looks awesome dude but you are correct, wrong section im gonna try it now, will report in 5 mins!
Samsung Galaxy S2.

CM9/MIUI.

Gingerbread 2.3.7.



 
E_man5112
Old
#5  
Senior Member
Thanks Meter 35
Posts: 639
Join Date: Jul 2010
A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is
 
sirphunkee
Old
#6  
sirphunkee's Avatar
Retired Senior Moderator
Thanks Meter 96
Posts: 2,930
Join Date: Dec 2009
Location: Austin, TX

 
DONATE TO ME
abra-cadabra...

*POOF*

Done!

TESTER OF DA FUNK_____________________________________________


(T-Mobile US HD2)
ROM: 2.10.531.1 (82076) WWE/5.2.21889 (Stock 6.5)
Sense: 2.5.2012
Radio: 2.08.50.08_2


(T-Mobile US TouchPro2)
ROM: 1.91.531.4 (74508) WWE/5.2.21881 (Stock 6.5)
Sense: 2.1.1921
Radio: 4.49.25.57

"And asking which [ROM] is the best is a lot like asking 10 guys in a bar what the best beer in the world is."

Girlfriend not getting your SMS messages? SOLVED! (Must try EVERY step!)

PLEASE VOTE FOR YOUR FAVORITE HTC DEVICE OF 2010

*PhunkPhund*
 
RyanZA
Old
#7  
Senior Member - OP
Thanks Meter 726
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Quote:
Originally Posted by E_man5112 View Post
A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is
The old one is still here. Nothing has changed that should stop it working on the captivate though, but it is completely untested. Use the 1.0 (which has had a lot of testing) until this one has been put through the paces.
 
RyanZA
Old
#8  
Senior Member - OP
Thanks Meter 726
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Quote:
Originally Posted by sirphunkee View Post
abra-cadabra...

*POOF*

Done!
Thanks.
 
amerikian
Old
#9  
Senior Member
Thanks Meter 17
Posts: 225
Join Date: Mar 2007
Location: madison
Quote:
Originally Posted by RyanZA View Post
The old one is still here. Nothing has changed that should stop it working on the captivate though, but it is completely untested. Use the 1.0 (which has had a lot of testing) until this one has been put through the paces.
Quote:
Originally Posted by E_man5112 View Post
A few people in the other thread said they had the first lag fix working on the captivate. Anything that might change that with this release? I came to download the old one, and here a new one is
I'm running the manual ext2 fix with Q scores 2000+. I'll try 2.0 Util tonight and post feedback....
 
Dominik06
Old
#10  
Member
Thanks Meter 0
Posts: 50
Join Date: May 2009
Location: Vienna
Someone got some benchmarks?
Maybe for xxjp3? I only reach 1900 in quadrant.. /:

Sent from my GT-I9000 using Tapatalk

Tags
fix, lag
THREAD CLOSED
Subscribe
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes