[Desire Android Development] ClassicalDude:
This is a picture of the memory layout of a regular HTC Desire running an RCMIxHD derivative (SupeROM) with the speed and responsiveness of a Desire HD.​

Premise:

1. Performance degradation with HD roms (and regular ones as well) occur when essential parts of the device's operation are from the sd card, instead of working as much as possible from the internal memory.

2. Deodexed roms render a substantial part of the /system partition into a bloated archive, since no apk or jar file is actually used. Everything is odexed and copied into the dalvik-cache, which leads to -

3. The dalvik-cache of a deodexed rom is much larger than that of an odexed rom. So now we have large portions of the system partition that are not used, and a clogged data partition.

4. So we use a2sd, a2sd+, d2ext or d2we - and essentially, what we get is that almost nothing is being run from the internal memory. What a waste.

This post will be a guide for both devs and advanced users on a process that utilizes s-off'ed devices' ability to change partition layouts in order to maximize the efficiency of the device.

For devs:

0. Require the target device to be s-offed and have an hboot in accordance with the following ideas:

1. Instead of using d2ext, d2we or even a2sd+ - use a regular a2sd script, and move only /data/app to the sd card. This will act as the apk archive of downloaded apps, while the dalvik-cache, from which the apps actually run, will remain on the data partition.

2. Symlink the entire /system/app folder and /system/fonts folder to sd-ext. Symlink everything in /system/framework to sd-ext, except framework-res.apk and possibly framework.jar (for theme modding and rtl fixes, if necessary).

The result - a regular Sense FroYo rom will take only 89mb of the /system partition. RCMixHD will take 180mb - and that is after returning the VR lib folder and some other libs to the /system partition.

In other words - you can use the oxygen hboot for normal Sense FroYo, and the data++ hboot for HD-based roms. All the files will run from the dalvik-cache on the data partition, and all the user data will be there as well.

Fixing market downloads

If you wish to bypass the problem of the small cache partition limiting market downloads, then do the following steps:

1. Use the wonderful dsixda kitchen to unpack your boot.img

2. Edit the init.rc. In the exports section add the following:

export DOWNLOAD_CACHE /mnt/asec/download

and add the following right under the section titled "# Secure container public mount points":

# Market downloads
mkdir /mnt/asec/download 0777 root system
mount tmpfs tmpfs /mnt/asec/download mode=0777,gid=1000

This will place all market downloads into a temporary ram disk, which will be deleted upon the completion of the installation.

3. Repack your boot.img and place it in the rom.

You can see an example of an edited init.rc here:

http://wbss.ro/coolexe/Extra/init.rc

Note: The users of your rom will still have to flash radio updates through fastboot.

(Thanks, coolexe and baadnewz, for this idea!)

The result is maximal device responsiveness, as well as battery conservation.

An example for a modified rom (SupeROM) can be downloaded here. This one requires the data++ hboot. baadnewz's newest iNserCoinHD rom also uses it - see here.

The following post is a guide for advanced users on how to achieve the same effect on an already running rom.