If you have a jailbroken iPhone, it's very likely that you installed a lot of apps, tweaks and extensions that are now slowing down your device. Perhaps you noticed that it's not as fast as it used to be, applications like Mail take a little longer to start up, you have to respring every 30 minutes to see an increment in speed. You know why? Because the stuff you install from Cydia eats up memory, a lot of memory sometimes. Winterboard, for example, can take a lot of unoccupied RAM if you start enabling dozens of themes and graphical modifications; same applies for other apps like Action Menu, Pro Switcher - all these things constantly run in the background (they are based on MobileSubstrate) and they are the reason why your iPhone is slowing down.
Fortunately, there are some tricks and tips you can follow to optimize your iPhone, free up a lot of memory without the need of respringing / rebooting and get a fast and stable device once again. Here's how.
First thing you have to know is that you need SSH access to your iPhone to perform the following actions; to do so, you just have to install OpenSSH from Cydia and have a ftp desktop client like Cyberduck to access the file system and thus be able to copy / remove files.
Just like on Mac OS X, there are many language packs into your iPhone that most of the time are unused and they're just there to eat space. And if we removed unused languages from our Macs, why not do the same on the iPhone? Thanks with a simple script called "LangPack" you can choose every single language to keep or delete, and I can assure you'll see the difference after the removal. Faster loading times for applications and reboot, and of course less space. The script comes with a good forum topic, together with the instructions to make it work, which are really basic. Also, please note that you'll have to install MobileTerminal from Cydia to launch it and don't delete the Japanese language if you're using Emoji.
But what really helped speeding up my iPhone was removing launch daemons. From Wikipedia:
In Unix and other computer multitasking operating systems, a daemon is a computer program that runs in the background, rather than under the direct control of a user; they are usually initiated as background processes.
This means that everytime you turn your iPhone on, the OS will load up these background process, which run independently from the user and that - guess what - consume memory. And if you consider that the basic daemons are around 54, that's a huge amount of memory. The jailbreak scene has been great so far in analyzing iPhone OS (sometimes even putting devices at risk) and discovering stuff that Apple doesn't of course make public, like the role that background daemons have. It turns out that a good part of these daemons can be removed (deleted) without visible damages to the OS or differences in usage, freeing up a very small amount of space (the files you'll delete are a few kb in size) but unlocking a huge part of RAM that otherwise would be taken by the aforementioned daemons.
The daemons are located in /System/Library on your iPhone, and I suggest you to make a backup copy just in case something goes wrong.
There are 4 categories of daemons: System, Jailbreak-only,Conditional (you decide if you need them or not) and Safe. I recommend you to act only on the Safe ones, as no one has ever reported of adverse effects after deleting them. Also, the jailbreak daemons are installed by apps you install from Cydia, be sure to clean them up every once in a while. These are the daemons I deleted:
And like I said, no effects or problems so far (it's been more than a week now.) But on the other hand, the effect on speed has been amazing: my iPhone now only takes 2 second to respring, less than 10 to reboot and be fully operative. Also, apps launch way faster than before and, even with a couple of MobileSubstrate extensions enabled, the iPhone feels a lot snappier and, overall, more responsive. Modmyi has a good post about this process.
Last, there are some other tips I'd like to share and they are more conceptual than practical. First, try to not install every single thing you think it's cool from Cydia: especially if the tweaks are based on MobileSubstrate, they're gonna slow down your iPhone, period. Themes (with Winterboard) are another thing you have to keep under control, as you may end up with 13 activated themes and a phone that runs like it's Windows Vista time again.
All in all, trying to optimize a jailbroken phone is a very difficult tasks, considering that Cydia apps are weekly updated and that you have to start over after every new iPhone OS and jailbreak. You have more tips to share? We have the comments for that.