[AT&T, Rogers HTC One X, Telstra One XL] thelonewolf_pav:
First step to smoothness: swap and OOM

DISCLAMER. The script below plays with your system settings. It might cause bootloops, brick your device or start nuclear war. Please use at your own risk.

So, first thing I noticed was that the phone was getting slow because it didn't have enough memory to run. I figure that CM12 and lollipop in general is probably optimized for 2GB RAM, whereas our device has only 1GB. So I tried to play with OOM values, but didn't get the desired results. So I went and enabled swap. Guess what? Works like a charm.

Here's how I did it:

1. install SuperSU from here .

2. open it and let it install its su module. this part might be tricky; for me, doing this via recovery didn't work and regular install didn't work either. i ended up having to open ADB terminal and setting SELinux to permissive manually, like so:

su

setenforce 0

and only after that did it succeed to push its su module to system/xbin.

3. go to SuperSU's settings and make sure you have checked the following:

a. Enable Superuser

b. Enable su during boot

c. Trust system user (this is not mandatory; however, if you don't check this, you will be flooded with requests to grant su to system apps)

4. after you have everything set up, reboot to recovery and install the attached zip like you would install a ROM.

5. reboot and enjoy your new silky smooth HOX :)

This script enables swap on data and cache. The files are pretty large, too: 250MB on data and 250MB on cache. I saw that even with this I still have plenty of room on data and cache to keep rolling. This gives me 0.5GB of swap, virtually enlarging my RAM to 1.5GB. This seems to be enough for all my needs.

The script also sets swappiness to 50, sets OOM to the values that work best for me at the moment and brings over several optimizations from my HD2 ROM. Feel free to edit the values and share.

EDIT: uninstalling script attached

EDIT2: scripts updated to reflect my latest changes.

EDIT3: reduced small (small_swap.zip) attached for those who want to use swap with ZRAM

Second step to smoothness: kernel

This step proved to be extremely important for smoothness. For some reason, stock CM12 kernel appears to be severely underoptimized... or the kernels that our devs generously made available for us are heavily overoptimized :)

To my best knowledge, currently there are only two kernels that work with LP and support swap: Torched Kernel v1.4 and Frosted Kernel.

IMPORTANT: if you are going to flash Torched kernel, be sure to flash LP version 1.3 or 1.4. Previous versions break swap, thus hurting speed and stability

IMPORTANT: if you are going to flash Bricked kernel, you ABSOLUTELY MUST flash the voltage table (see this post). First flash the kernel and then the voltage table. Not following this procedure can damage your phone.

I am currently using the Bricked kernel and the results are extremely impressive.

Third step to smoothness: Ext4 optimizations: disable journaling, enable dir_index

This step helps quite a bit if you decide to stay with ext4 for now. But even if you don't and want to switch to F2FS (see step 4), it's worth doing it on the /system partition.

WARNING. Journaling slows your system down quite a bit but it also adds stability. Please beware. You may lose your data or may even have to reflash your ROM in some extreme cases.

I never experienced any problems with non-journaling systems, but be aware that google enabled it for a reason.

Note: Your system might became unstable only if you forcefully shut the device down by long-pressing the power button or if you run out of battery. In case of normal work and normal shutdowns/restarts, everything will be fine.

1. Flash the attached zip (no_journal.zip).

2. Profit! Your cache, data and system partitions have no journaling now.

Fourth step to smoothness: F2FS

It took me some time to figure out this one, but it proved to be extremely helpful in terms of speed and general smoothness. Stability is yet to be tested, but I have it for ~24 hours now, and everything looks fine so far.

0. You need a F2FS-enabled TWRP. Luckily, we have jrior001 with us, who took care for that. Grab it from here (please thank jrior001 in his thread).

1. Install Torched kernel 1.4. (Bricked supports F2FS too, but for some reason, the performance is degraded and the stability is much worse than with Torched).

1a. If you had Bricked installed, remove undervolt script from /system/etc/init.d

2. Install attached zip (evita_F2FS_conversion_v2.0_pav.zip). This will enable you to work either with ext4 (with some extra optimizations) or with F2FS, so you can always go back without having to remove it. (note that you'll have to flash this zip each time you install a new kernel)

3. In TWRP, go to Backup, select data and cache and unselect system. I also disabled compression, just in case. Start the backup and wait for it to finish.

3a. STOP! Check that backup returned no errors. If there were errors during the backup, don't go any further or you'll lose your data!

4. Now connect your device to the PC. On PC, browse to Computer\One X\Internal Storage\TWRP\BACKUPS\<number of your device>\<latest backup>

5. You will see a bunch of files whose name contains ext4. For example, data.ext4.win.md5

6. Go ahead and change ext4 to f2fs for each file. The names should now look as follows: data.f2fs.win.md5

7. Back in TWRP, choose Restore -> your latest backup.

8. Sit back and relax while TWRP reformats your data and cache partitions as F2FS and restores all your data.

9. Reboot and enjoy!

10. If you'll ever want to go back to ext4, just go to TWRP, connect your device to the PC, on your PC, restore the original names of the backup files (rename f2fs to ext4), in TWRP choose restore and you're back to where you stated