[MOD] [TWEAKS] Thunderbolt Mod for Smoothness, Performance & Battery improvements

Search This thread

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
[MOD] [TWEAKS] Thunderbolt Mod for Smoothness, Performance & Battery improvements

Introduction -

This thread is intended to introduce Thunderbolt! Mod by @pikachu01 to Galaxy SIII users. (I did ask for and got Moderator permission due to perceived duplicate nature of the thread.)

First and foremost, here is the Original Thunderbolt thread. I do not take credit for the mod. All thanks go to @pikachu01.

Practically all the D2TMO/D2ATT/D2SPR/D2VZW users are using one version or other of Jelly Bean. So, although the original thread covers anything from Gingerbread to Jelly bean, I wish to provide a simple set for JB specific usage. Another reason for this thread is to explain what this mod does so that the average user understands what's going to happen and also be able to distinguish with other Mods. I have personally used this mod and given that I understand the underlying principle, I strongly recommend this mod.

Benefits -

  • Better performance through Linux kernel tweaks catered for Android OS and flash memory.
  • Better battery life through usage of screenstate_scaling whereby it switches thresholds/VM tunables depending on your screen state.
  • Better performance for database writes as fsync is not utilized any more.
  • Better network throughput from TCP tweaks and 3G tweaks.
  • Less RAM usage through zipaligning of all the apps.
  • Reduced /dbdata, /data, /sdcard usage of *.db files and faster database access through defragmentation of sqlite db files (a lot of apps use Database to store data like Swype dictionaries, Game saves etc)
  • Faster disk access through remount script (noatime, disable barrier etc)
What does it do -

I will try to explain as simply as possible what the mod does. This will help clarify for the first timers as well as experts.


  1. Partition Remount – Each Partition is Remounted with the Noatime option set. This will avoid a Write operation whenever Android reads from disc. Thus improving performance significantly.
  2. Optimizing SQLITE Database– SQLITE is a lightweight database used extensively in Android apps. Its the basis for saving application data and images. For each app, there is a separate instance. With significant write activity, the database gets fragmented and is not on consecutively arranged on the Flash storage. If this is optimized, read operations as well as write operations of every application will significantly boost. Thus improving overall smoothness. However, if you have a lot of applications and each application having lot of data in the database, (For ex. Games, TiBU or Social Media) optimization operation will take some time. Fortunately you don't have to do this frequently. Even once a week will do wonders.
  3. APK Re-Alignment – Each application comes packaged as APK or Android PacKage file. These are internally packaged as an archive. Within the archive, uncompressed data needs to be aligned with respect to beginning of the file. When aligned in this way, the files are read quicker and executed efficiently. This contributes to a smooth experience. Quiet a few apps on Google Play are not aligned when you install. This will eventually contribute to a sluggish and less than optimal experience. Aligning the files once a week will help avoid this. If you tend to install new apps frequently, you might be better off putting this file in init.d, so this will be executed at each boot.
  4. Network Parameter tweaking – In Build.prop, size values of buffers should be increased given higher RAM sizes on these phones. This tweak is pretty well known to most of the people on XDA.
  5. Scheduler Tweaking – This only applies to Kernels that implement CFS Scheduler. Users of KT747 Kernel can ignore this as that kernel does not implement CFS. For those who have it, tweaking the Scheduler parameters knowing the files are zipaligned, will render smoother experience.
Download & Installation -

I highly recommend taking a Nandroid backup before proceeding to flash this mod.


Download Link for the JellyBean Thunderbolt! Mod zip file download Link
- JellyBean Version.


  1. Copy the zip file to your SD Card (internal or external).
  2. Install Script manager from Google Play Store. Also optionally install Terminal Emulator (Only needed to verify successful install).
  3. Flash the Thunderbolt! zip in Recovery and then reboot the device.
  4. If you experince Boot Loops, please flash the undo script or restore your Nandroid. Let me know.
  5. Open Script Manager.
    1. Launch S98screenstate_scaling as Root (The Skull icon). If it executes successfully, set it to run at Boot (The Wheel Icon).
      NOTE - This script is not compatible with some Roms. Please test it to see if it works with your Rom before setting it to run at boot.
    2. Launch S98system_tweak as Root (The Skull icon). If it executes successfully, set it to run at Boot (The Wheel Icon).
    3. Launch /etc/bolt_scripts/remountNexus4 as Root (The skull icon) and as Boot (The wheel icon).
      Note - Given this re-mount is not for US versions of Galaxy S III, you may get errors on the subsequent screen. Ignore them and hit back button.
    4. Launch /etc/bolt_scripts/sqlite_optimize as Root (The skull icon).
      Note - This script can be used at anytime you want except at boot so do not set that way (the wheel icon) or from inside init.d. Given it's a very long running script, it will inordinately held up boot up process.
    5. Launch /etc/bolt_scripts/s70darky_zipalign as Root (The skull icon).
      Note - This script can be used anytime you want including as Boot (Wheel icon) or within init.d folder. If you copy it to init.d set its permission to rwx-rwx-rwx. Also note, this script is located under bolt_scripts since users with a large set of apps may experience quiet a bit of delay during boot up.
    6. Launch /etc/bolt_scripts/CFS/S98CFS as Root (The skull icon) and as Boot (The wheel icon).
    7. Launch /etc/bolt_scripts/S98TCPbuffers as Root (The skull icon) and as Boot (The wheel icon).
That's it. Enjoy!

PLEASE DO NOT FORGET TO THANKS :cowboy: @pikachu01 at his original thread here.

Reverting/Undoing ThunderBolt!

  • To revert ThunderBolt!, download the ThunderBolt! Restore.zip
  • Do note that reflashing your ROM will remove ThunderBolt! as well.
 
Last edited:

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
How to find out if it works

Use File Explorer/ Root Explorer/Root Browser, and navigate to

/system/etc/init.d/

There you should find (among other things) s98system_tweak file. That indicates successful flashing of the mod.

The longer method to confirm success, requires executing some commands via Terminal Emulator. Explore these inside the hidden text bellow if you wish.


The way to validate success and effectiveness of this mod is checking on how often the Kernel writes to internal SD card. For one, android scheduler does not perform an immediate write operation when the app requests it. It rather waits till its buffer is full and then does the write. Secondly, given its solid state storage, it is extremely fast compared to your computer. So what we are doing here is modifying the Buffer size in accordance with your Ram. The more the ram, the bigger the buffer.

The third parameter, vfs_cache_pressure actually tells the kernel to favor File System Cache. So the ram will fill up for the File system cache, thus increasing application performance.

So to test, using Terminal Emulator, do the following Steps. Press Enter after each to execute them individually.

To enter superuser mode and then execute,
Code:
SU
sysctl -a | grep vm
You will get a screen like this.
T_JB_Output.png


You are looking for the values highlighted in the screen.

If your phone has 1GB Ram or less, you should see values like bellow,

Code:
vm.dirty_background_ratio = 10 
vm.dirty_ratio = 20 
vm.vfs_cache_pressure = 50
Since Galaxy SIII has 2 GB Ram, you should expect to see values like this

Code:
dirty_background_ratio = 5 
dirty_ratio = 10
vfs_cache_pressure = 50
With the phone screen off, you may use ADB to run the same commands.

Code:
su 
sysctl -a | grep vm
ADB should get these values with the phone screen turned off.

For devices with 1GB RAM devices or below, you should see in the output,

Code:
dirty_background_ratio = 20 
dirty_ratio = 40 
vfs_cache_pressure = 100
For Galaxy S III, given it has 2 GB Ram, you should see,
Code:
dirty_background_ratio = 10 
dirty_ratio = 20 
vfs_cache_pressure = 100
 
Last edited:
  • Like
Reactions: thetolsonator

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
Q&A REGARDING THE MOD -

Please note, there are also following MODs compatible with Galaxy SIII, that I am aware of. However they differ from this mod. So I have given a short Summary of the distinction between those mods and this one.

1. How is this different from Crossbreeder ? So which Mod is better ?

Crossbreeder by @idcrisis is a mod that focuses on better implementation of DNS Catching and Parallalization of DNS queries. It also improves on tethering and blocks Ads. Last but not the least, it also modifies Entropy levels like Seeder.

What Thunderbolt does, is more on installed Apps and disk I/O improvement. So those two MODs can co-exist just fine and do not conflict or have overlapping functionality.

2. How is Thunderbolt different from V6 SuperCharger Mod by @zeppelinrox ?

V6 Supercharger focuses on invincibility of the Android Launcher. This could be any Launcher you are using as default. It also tweaks significantly to Android's Low Memory Management (AKA Low Memory Killer). This latter will significantly improve Multitasking capabilities.

As you see, this too is quiet different from what Thunderbolt does. So there is no overlap or competition per se. You can implement both at the same time.

2. How is Thunderbolt different from Operation Killjoy Mod by @Exit_Only ?

I am investigating the compatibility. Until then Unless noted, the two are not compatible with each other.
Note - If I have not mentioned a compatible Mod, then please let me know and I will be more than happy to post it here.
 
Last edited:
  • Like
Reactions: thetolsonator

Supamike88

Senior Member
Nov 7, 2010
767
53
Running Dandroid. I flashed the mod and it gets stuck on bootscreen

Sent from my SGH-T999 using xda app-developers app
 

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
Running Dandroid. I flashed the mod and it gets stuck on bootscreen

Sent from my SGH-T999 using xda app-developers app
Thanks for testing.

Do you have a lot of applications installed on your phone ? Also at what step did it get stuck at boot screen ?

Please note, as I said earlier in the thread, while executing boot up script, the phone may appear to be stuck at Boot screen but will eventually come back. It is very important to know at what step it got stuck at boot.
 

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
Is this compatible with Killjoy?

Sent from my SGH-T999 using Tapatalk 2
If you are referring to the Touchwiz Killjoy Rom, yes I believe so.

Please note, given that rom is Touchwiz, the Remount script in op may not work. So please do not set it to run at Boot.
 

Supamike88

Senior Member
Nov 7, 2010
767
53
Thanks for testing.

Do you have a lot of applications installed on your phone ? Also at what step did it get stuck at boot screen ?

Please note, as I said earlier in the thread, while executing boot up script, the phone may appear to be stuck at Boot screen but will eventually come back. It is very important to know at what step it got stuck at boot.

I downloaded the mod, rebooted into recovery, flashed the mod, rebooted and waited for it to load but it never got past the splash screen. I waited for about 5 minutes

Sent from my SGH-T999 using xda app-developers app
 

LuigiBull23

Senior Member
Jan 22, 2013
6,666
6,307
33
Holyoke
I believe he's referring to the Operation Killjoy script by Team Kernelizer member @Exit_Only and if that's the case then unless stated otherwise, this will not work alongside Killjoy. As of right now the only approved script package to run with Killjoy is Croossbreeder.
 
  • Like
Reactions: Perseus

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
I downloaded the mod, rebooted into recovery, flashed the mod, rebooted and waited for it to load but it never got past the splash screen. I waited for about 5 minutes
When you flashed in Recovery, I am sure there was a screen with Script output. I'd love to see what it looked like.

Also before you flashed the mod, did Dandroid happen to have any scripts in init.d folder ? If yes, can you attach them ?

Lastly Can you revert to your Nandroid Backup and try this file instead ?

I believe he's referring to the Operation Killjoy script by Team Kernelizer member @Exit_Only and if that's the case then unless stated otherwise, this will not work alongside Killjoy. As of right now the only approved script package to run with Killjoy is Croossbreeder.
Thanks Luigi for clarifying. I will add to my Q&A
 
Last edited:
  • Like
Reactions: LuigiBull23

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
Where is your DL link? :confused:
Fell trap to my own irritation.

I have set the color correctly to show the link in the OP. Also this link gives the Mod zip file. This other link will give you UNDO File to Remove the mod.

How ungrateful of me.. Thank you Perseus for putting this thread together for us.. Very convenient and well organized. Subscribed! :cowboy:
Its all good Luigi. Thanks for the kind word.
 
  • Like
Reactions: LuigiBull23

damathos

Senior Member
Jan 23, 2008
149
26
Minneapolis
I downloaded the mod, rebooted into recovery, flashed the mod, rebooted and waited for it to load but it never got past the splash screen. I waited for about 5 minutes

Sent from my SGH-T999 using xda app-developers app

Same thing here... I got stuck at the splash screen.
Using a LG L9 (p769), rooted, CWM installed, busy-box installed, init.d installed.

Used to work with the original Pika's version...
 

Perseus

Retired Senior Moderator / Recognized Developer
Feb 10, 2011
10,626
8,471
Atlantis
Same thing here... I got stuck at the splash screen.
Using a LG L9 (p769), rooted, CWM installed, busy-box installed, init.d installed.

Used to work with the original Pika's version...
I do assume you have Jellybean on your L9 ? Unlike original Pikachu's version, this is JB specific.

Like I asked the other poster,
1. What Rom & Kernel are you running ?
2. would you please provide the screen from Recovery that shows outcome of the flash ? (Typically you get to save the script output as text.)
 

damathos

Senior Member
Jan 23, 2008
149
26
Minneapolis
I do assume you have Jellybean on your L9 ? Unlike original Pikachu's version, this is JB specific.

Like I asked the other poster,
1. What Rom & Kernel are you running ?
2. would you please provide the screen from Recovery that shows outcome of the flash ? (Typically you get to save the script output as text.)

Rom is stock (760 20f), using Jelly Bean 4.1.2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    [MOD] [TWEAKS] Thunderbolt Mod for Smoothness, Performance & Battery improvements

    Introduction -

    This thread is intended to introduce Thunderbolt! Mod by @pikachu01 to Galaxy SIII users. (I did ask for and got Moderator permission due to perceived duplicate nature of the thread.)

    First and foremost, here is the Original Thunderbolt thread. I do not take credit for the mod. All thanks go to @pikachu01.

    Practically all the D2TMO/D2ATT/D2SPR/D2VZW users are using one version or other of Jelly Bean. So, although the original thread covers anything from Gingerbread to Jelly bean, I wish to provide a simple set for JB specific usage. Another reason for this thread is to explain what this mod does so that the average user understands what's going to happen and also be able to distinguish with other Mods. I have personally used this mod and given that I understand the underlying principle, I strongly recommend this mod.

    Benefits -

    • Better performance through Linux kernel tweaks catered for Android OS and flash memory.
    • Better battery life through usage of screenstate_scaling whereby it switches thresholds/VM tunables depending on your screen state.
    • Better performance for database writes as fsync is not utilized any more.
    • Better network throughput from TCP tweaks and 3G tweaks.
    • Less RAM usage through zipaligning of all the apps.
    • Reduced /dbdata, /data, /sdcard usage of *.db files and faster database access through defragmentation of sqlite db files (a lot of apps use Database to store data like Swype dictionaries, Game saves etc)
    • Faster disk access through remount script (noatime, disable barrier etc)
    What does it do -

    I will try to explain as simply as possible what the mod does. This will help clarify for the first timers as well as experts.


    1. Partition Remount – Each Partition is Remounted with the Noatime option set. This will avoid a Write operation whenever Android reads from disc. Thus improving performance significantly.
    2. Optimizing SQLITE Database– SQLITE is a lightweight database used extensively in Android apps. Its the basis for saving application data and images. For each app, there is a separate instance. With significant write activity, the database gets fragmented and is not on consecutively arranged on the Flash storage. If this is optimized, read operations as well as write operations of every application will significantly boost. Thus improving overall smoothness. However, if you have a lot of applications and each application having lot of data in the database, (For ex. Games, TiBU or Social Media) optimization operation will take some time. Fortunately you don't have to do this frequently. Even once a week will do wonders.
    3. APK Re-Alignment – Each application comes packaged as APK or Android PacKage file. These are internally packaged as an archive. Within the archive, uncompressed data needs to be aligned with respect to beginning of the file. When aligned in this way, the files are read quicker and executed efficiently. This contributes to a smooth experience. Quiet a few apps on Google Play are not aligned when you install. This will eventually contribute to a sluggish and less than optimal experience. Aligning the files once a week will help avoid this. If you tend to install new apps frequently, you might be better off putting this file in init.d, so this will be executed at each boot.
    4. Network Parameter tweaking – In Build.prop, size values of buffers should be increased given higher RAM sizes on these phones. This tweak is pretty well known to most of the people on XDA.
    5. Scheduler Tweaking – This only applies to Kernels that implement CFS Scheduler. Users of KT747 Kernel can ignore this as that kernel does not implement CFS. For those who have it, tweaking the Scheduler parameters knowing the files are zipaligned, will render smoother experience.
    Download & Installation -

    I highly recommend taking a Nandroid backup before proceeding to flash this mod.


    Download Link for the JellyBean Thunderbolt! Mod zip file download Link
    - JellyBean Version.


    1. Copy the zip file to your SD Card (internal or external).
    2. Install Script manager from Google Play Store. Also optionally install Terminal Emulator (Only needed to verify successful install).
    3. Flash the Thunderbolt! zip in Recovery and then reboot the device.
    4. If you experince Boot Loops, please flash the undo script or restore your Nandroid. Let me know.
    5. Open Script Manager.
      1. Launch S98screenstate_scaling as Root (The Skull icon). If it executes successfully, set it to run at Boot (The Wheel Icon).
        NOTE - This script is not compatible with some Roms. Please test it to see if it works with your Rom before setting it to run at boot.
      2. Launch S98system_tweak as Root (The Skull icon). If it executes successfully, set it to run at Boot (The Wheel Icon).
      3. Launch /etc/bolt_scripts/remountNexus4 as Root (The skull icon) and as Boot (The wheel icon).
        Note - Given this re-mount is not for US versions of Galaxy S III, you may get errors on the subsequent screen. Ignore them and hit back button.
      4. Launch /etc/bolt_scripts/sqlite_optimize as Root (The skull icon).
        Note - This script can be used at anytime you want except at boot so do not set that way (the wheel icon) or from inside init.d. Given it's a very long running script, it will inordinately held up boot up process.
      5. Launch /etc/bolt_scripts/s70darky_zipalign as Root (The skull icon).
        Note - This script can be used anytime you want including as Boot (Wheel icon) or within init.d folder. If you copy it to init.d set its permission to rwx-rwx-rwx. Also note, this script is located under bolt_scripts since users with a large set of apps may experience quiet a bit of delay during boot up.
      6. Launch /etc/bolt_scripts/CFS/S98CFS as Root (The skull icon) and as Boot (The wheel icon).
      7. Launch /etc/bolt_scripts/S98TCPbuffers as Root (The skull icon) and as Boot (The wheel icon).
    That's it. Enjoy!

    PLEASE DO NOT FORGET TO THANKS :cowboy: @pikachu01 at his original thread here.

    Reverting/Undoing ThunderBolt!

    • To revert ThunderBolt!, download the ThunderBolt! Restore.zip
    • Do note that reflashing your ROM will remove ThunderBolt! as well.
    2
    How ungrateful of me.. Thank you Perseus for putting this thread together for us.. Very convenient and well organized. Subscribed! :good:
    1
    How to find out if it works

    Use File Explorer/ Root Explorer/Root Browser, and navigate to

    /system/etc/init.d/

    There you should find (among other things) s98system_tweak file. That indicates successful flashing of the mod.

    The longer method to confirm success, requires executing some commands via Terminal Emulator. Explore these inside the hidden text bellow if you wish.


    The way to validate success and effectiveness of this mod is checking on how often the Kernel writes to internal SD card. For one, android scheduler does not perform an immediate write operation when the app requests it. It rather waits till its buffer is full and then does the write. Secondly, given its solid state storage, it is extremely fast compared to your computer. So what we are doing here is modifying the Buffer size in accordance with your Ram. The more the ram, the bigger the buffer.

    The third parameter, vfs_cache_pressure actually tells the kernel to favor File System Cache. So the ram will fill up for the File system cache, thus increasing application performance.

    So to test, using Terminal Emulator, do the following Steps. Press Enter after each to execute them individually.

    To enter superuser mode and then execute,
    Code:
    SU
    sysctl -a | grep vm
    You will get a screen like this.
    T_JB_Output.png


    You are looking for the values highlighted in the screen.

    If your phone has 1GB Ram or less, you should see values like bellow,

    Code:
    vm.dirty_background_ratio = 10 
    vm.dirty_ratio = 20 
    vm.vfs_cache_pressure = 50
    Since Galaxy SIII has 2 GB Ram, you should expect to see values like this

    Code:
    dirty_background_ratio = 5 
    dirty_ratio = 10
    vfs_cache_pressure = 50
    With the phone screen off, you may use ADB to run the same commands.

    Code:
    su 
    sysctl -a | grep vm
    ADB should get these values with the phone screen turned off.

    For devices with 1GB RAM devices or below, you should see in the output,

    Code:
    dirty_background_ratio = 20 
    dirty_ratio = 40 
    vfs_cache_pressure = 100
    For Galaxy S III, given it has 2 GB Ram, you should see,
    Code:
    dirty_background_ratio = 10 
    dirty_ratio = 20 
    vfs_cache_pressure = 100
    1
    Q&A REGARDING THE MOD -

    Please note, there are also following MODs compatible with Galaxy SIII, that I am aware of. However they differ from this mod. So I have given a short Summary of the distinction between those mods and this one.

    1. How is this different from Crossbreeder ? So which Mod is better ?

    Crossbreeder by @idcrisis is a mod that focuses on better implementation of DNS Catching and Parallalization of DNS queries. It also improves on tethering and blocks Ads. Last but not the least, it also modifies Entropy levels like Seeder.

    What Thunderbolt does, is more on installed Apps and disk I/O improvement. So those two MODs can co-exist just fine and do not conflict or have overlapping functionality.

    2. How is Thunderbolt different from V6 SuperCharger Mod by @zeppelinrox ?

    V6 Supercharger focuses on invincibility of the Android Launcher. This could be any Launcher you are using as default. It also tweaks significantly to Android's Low Memory Management (AKA Low Memory Killer). This latter will significantly improve Multitasking capabilities.

    As you see, this too is quiet different from what Thunderbolt does. So there is no overlap or competition per se. You can implement both at the same time.

    2. How is Thunderbolt different from Operation Killjoy Mod by @Exit_Only ?

    I am investigating the compatibility. Until then Unless noted, the two are not compatible with each other.
    Note - If I have not mentioned a compatible Mod, then please let me know and I will be more than happy to post it here.
    1
    I believe he's referring to the Operation Killjoy script by Team Kernelizer member @Exit_Only and if that's the case then unless stated otherwise, this will not work alongside Killjoy. As of right now the only approved script package to run with Killjoy is Croossbreeder.