Cydia is a popular apt front end for iOS created by Jay Freeman (better known as Saurik). I’ve lately seen allot of complaints about it being slow. Ever since I shut down my reasonably fast browser based Cydia alternative people were disappointed. So I decided that I should perhaps put some time in to making Cydia faster. To figure out where the slowness comes from we first have to see how Cydia works.

Reloading data

At first Cydia downloads lists with packages from repositories. These lists are often big in size. To solve this problem Saurik already worked with a few major repository owners. Most major repositories now use diff files, which means that instead of downloading a big file of packages every time, you just download a file which contains the packages which got added to the repository, the packages which got updated and the packages which got removed. Next up the packages files will get updated and cached on your device. Cydia will present you with the famous reloading data screen as it does that and updates any views in the app which are currently active. This process is often seen as a lengthy process by users.

Search

Cydia’s search as you type feature which presents you with the first few results is pretty fast. However if you want a full listing of search results, you will end up waiting a while again.

A possible cause of “the problem”

Earlier today I posted the following pie-chart on twitter

This chart was generated based on my package database which I obtained using my Cydia crawler which was earlier used in Lima. From this pie chart it becomes clear that 75% of the packages which are on the default Cydia repositories are themes. Themes are great additions to your device, but there just are too many. Themes are the easiest Cydia packages to make, explaining why there are so many of them. There is a strong difference in quality of themes. That difference in quality also reflects on the download count of themes. Allot of themes on Cydia get downloaded a couple hundred times on the first day and then remain untouched for years after that. This does not only apply to themes, it also applies to many other packages on Cydia (bootlogos, ringtones, fart apps, etc.).

Solutions

There are a couple solutions to this problem which I came up with. Most of them would have to come from the repository owners.

Cleanup: Repositories could clean up their packages databases. For example, by removing all non essentials packages which have not been downloaded for over a year. This would already make the amount of packages on Cydia significantly smaller.

Repositories could clean up their packages databases. For example, by removing all non essentials packages which have not been downloaded for over a year. This would already make the amount of packages on Cydia significantly smaller. Separation: There could be a separate repository for just themes. All the hardcore theme lovers could install that repository and get instant access to thousands of themes.

There could be a separate repository for just themes. All the hardcore theme lovers could install that repository and get instant access to thousands of themes. Server side package list separation: This will have the same effect as separation but in my opinion it would be a bit more elegant. It would work as follows. Repositories make a couple different package lists available on their servers. One list which has all of their packages, one list with all the packages except for Themes, ringtones, wallpapers and bootlogos and a couple other alternative combinations. Next in Cydia the user can indicate which list it wants to load. Then Cydia requests that specific list from the repository during a data refresh. This could work similar to the way repositories can separate software distributions (unstable, stable, testing, etc.).

This will have the same effect as separation but in my opinion it would be a bit more elegant. It would work as follows. Repositories make a couple different package lists available on their servers. One list which has all of their packages, one list with all the packages except for Themes, ringtones, wallpapers and bootlogos and a couple other alternative combinations. Next in Cydia the user can indicate which list it wants to load. Then Cydia requests that specific list from the repository during a data refresh. This could work similar to the way repositories can separate software distributions (unstable, stable, testing, etc.). My solutions (testing phase): I am currently working on creating a tool which will automatically split package lists in to more specified filtered/cleaned up package lists. It takes any list of packages and splits it up in a couple smaller categorized lists. More information to come soon.

Testing results



Using my tool I generated 4 new package lists for the default Cydia repositories. These package lists contained all the packages except for themes, ringtones and bootlogos. I ran speed tests on 4 different actions:

Cydia start up: Time from tapping the icon till it shows the user interface (Excluding reloading data time).

Time from tapping the icon till it shows the user interface (Excluding reloading data time). Reloading data: Timed after hitting the refresh button under the changes section. Time during which the “reloading data” spinner is shown.

Timed after hitting the refresh button under the changes section. Time during which the “reloading data” spinner is shown. Search query: Searching for a keyword, time from tapping search to seeing the full list of results.

Both tests were run under the same conditions (after a fresh reboot, no other sources added, no other apps opened). All test were ran on an older iPod touch 3rd generation running iOS 5.1. Each measurement was done 5 times for more accuracy. Below the average times in seconds are listed.

From these results we can conclude, that running Cydia without all those themes will make it almost twice as fast. I hope the repository owners can learn something from this post. However I’m assuming that they know everything which is in this post already,

If you have questions or comments, post them below or shoot me a tweet!

Edit: Tumblr seems to downscale my images, get them full size here: http://imgur.com/a/pl7L8