[LG Optimus 3D] pandaball:
Well, since there's an open invitation, might as well crash the how-to-dev party with some scripts you can use right off the bat. They are as attached, feel free to use them.They are a part of the tweaks I use for my rom. Noticeable improvements over stock this way, although they more or less deal with usability rather than performance so benchmarks might not improve as much as you'd expect. Dump them in /system/etc/init.d with permissions 0644 with a kernel that supports init.d (in other words, any custom kernel on this forum) and you're good to go.

However, since we're here, why not study how init.d works? Better to understand what these scripts do and how they impact performance, no?

Disclaimer: Some of these tweaks (like the one I'm going to explain below) were taken from the very awesome knzo (http://xdaforums.com/showthread.php?t=1227269). However it has a ways to go in terms of explaining what the commands do so this post is entirely dedicated to that.

The scripts are very nicely named, giving you an idea of what they do. However, what do the strange numbers in front mean? Simply put, during bootup the kernel will run these scripts according to the numbers, so 65ZipAlign will run first, followed by 70Ext4Mount and so on.

Now, open 70Ext4Mount using notepad, notepad++, what have you. You'll see a bunch of variables and values, but at the start it is of paramount importance to add #!/system/bin/sh to the first line, else the script will not even execute as there is nothing defined to execute or write these values.

What do the values/commands do, you may ask.

Let's analyse this command in sections.

tune2fs is just the code that runs the commands that follow after it.

-o journal_data_writeback tells tune2fs to write to the filesystem to enable journal data writeback. This typically provides the best ext4 filesystem performance.

/dev/block/mmcblk0p7 is the partition to apply the above commands to. In this case, mmcblk0p7 is /system.

Now, the other command is this

This time, the parameters are slightly different.

-O ^has_journal removes journaling, which is basically a filesystem log service. It takes up system resources, so removing journaling will improve system responsiveness. Note that -o and -O are different, the parameters are case-sensitive. -o configures the mount/filesystem options, -O enables/disables features.

Finally, at the bottom you get this line

As seen, the above is just a bunch of parameters. What do they all mean?

busybox mount -o mounts the partition named at the end, which is system. -o enables the mounting options.

remount, well, remounts the partition with the options named.

noatime disables the filesystem from writing the last accessed time to each file. When enabled, every read operation must have a write operation to write the last access time. With this option, only the read operations are done, removing the need for a write operation as well, giving a significant I/O boost.

noauto_da_alloc is a bit complex. When a file is edited in Linux, a new file is created containing the changes, then when it is saved, the new file is renamed and overwrites the old file. In ext3, it causes no problems since ext3 guarantees that either the old or new data will be on disk (when I say disk, it really means memory/eMMC) due to its default journaling mode. However, ext4 delays allocation, and thus the new file contents may not be written to disk before the file is renamed. Because of this, Linux kernels force the data to be written immediately which creates a performance hit. Disabling this will improve I/O by a bit. This may not be to everyone's liking since it creates the possibility of losing data, but such a thing has never happened to me. You can remove it if you like ;)

nodiratime is the same as noatime, except this applies to directories being accessed rather than files.

barrier=0 disables the use of write barriers. Write barriers enforce proper on-disk ordering of journal commits, and is usually enabled due to possibility of data loss if power is lost. However because the O3D is a phone, it has a battery and this ensures data will not be lost as the system will not shut off abruptly due to power loss. Removing barriers gives a performance boost.

nobh makes the phone avoid assigning buffer heads. Similar effects to barrier=0, similar dangers.

/system selects the partition to remount.

That's all for 70Ext4Mount. Congrats, you now know how one of the init.d scripts work ;) Now try figuring out the other 3. Google is your friend :)

This post is meant as a complement to samno's init.d mods, and only covers and explains a small section of what can be accomplished with init.d. I'll cover more when I find time :)

As always, props to samno for having such a thread. I must say, I haven't seen many forums where devs band together to impart to the community what we know :D

samno - feel free to copy the contents of this post into the OP(s) if you want to.