April 20, 2024
Saurik Explains Why Cydia Must Reload Packages at Launch

Saurik Explains Why Cydia Must Reload Packages at Launch

Posted February 28, 2012 at 3:40pm by iClarified
Saurik has taken to Reddit to answer a question on why Cydia must repeatedly reload packages at launch.

The refresh process occurs if its been more than 15 minutes since you last opened Cydia and here's why:

---
Cydia, unlike the App Store (or almost any similar service), stores the entire package catalog locally. This is why it can (quite quickly, in fact) render an insanely long table with all packages in it that you can just fling your way through, while the App Store shows you 25 packages at a time with a slow "load more" button.


However, this means that it actually has to keep that many packages locally, and has to keep their records up to date. From a "cold start", downloading the package catalog is something like three megabytes, compressed (totalled from BigBoss, ModMyi, and ZodTTD).

Downloading those large files, often at around the same time other people are downloading them, from centralized and not terribly well organized hosting, really sucks. This is made even worse by them often not following my recommendations on "diff indices" (causing you to have to redownload the entire catalogs randomly).

However, honestly, even that isn't a serious problem unless everyone is coordinating their downloads due to a jailbreak or something: the key issue is that the reason we have this distributed package catalog infrastructure is because people can and do use entirely-random totally-third-party repositories.

While BigBoss, ModMyi, etc. are setup with diff-indices, almost no other repositories in the ecosystem are. If you install another large repository, you are probably downloading that entire catalog every time it refreshes (which might be almost a megabyte of data, even compressed), from some likely sketchy/small server.


If that server is offline, it is an even more serious problem: TCP sucks over mobile protocols, and it is really difficult to just claim "ok, that server is down" rather than "that server is slow" (difficult to impossible even in the best of cases). This can make that step take nigh-unto insanely long as it is trying to painstakingly download these files.

One possible solution to this is offline index updates, but there has been serious pushback on those in the past (as many users overseas, and even now in the US, have limited and even overly expensive data plans; it is important to not use data when they don't consider it "safe").

However, those cause the other problem that almost all users of Cydia simply don't realize that it is an offline app: seriously none of the services people compare it to work like that (the closest I can think of is the much-more-rare PreWare, the Cydia-a-like for WebOS).

This means that when users read about something online that is "now available", they open Cydia and if it isn't available they tweet, e-mail, call, comment... whatever they can figure out to do with a phrase similar to "why is it not in my Cydia".

Users are honestly more willing to believe they don't have the right source installed (as to them there are so many and they think they should have all of them on their phone... there are users out there with over 50 sources installed... I can't imagine what their refresh time must be like) than that they need to refresh some weird offline database.

Unfortunately, moving "fully online" (where each interaction with the app takes 2 seconds of network time and you can only see 25 packages at a time; aka, exactly like the App Store, which I find due to this to be frustratingly and painfully slow in comparison to a loaded copy of Cydia) isn't an option. :(

I ran some statistics a few days ago, and it is in fact the vast minority of people who stick only to the default repositories. The fun of Cydia simply seems to be installing and finding interesting repositories, some of which are run by two people in a garage, and some of which are run by large companies (often with a single package in them).

So, we are left in a place where we are constantly looking at ways of producing hybrid models, or at least figuring out ways to improve the performance of people who use the recommended subset of repositories. Certainly, I hate it when default repositories go offline temporarily, and am working with them to improve (or even outright replace) their hosting.

In the meantime, though: Cydia is an offline database containing tens of thousands of entries that has the user-requirement of being able to search and interact with those tens of thousands of entries in sufficiently "real-time" that users can rapidly and smoothly scroll through all of the packages in the entire catalog, filtered for a category or sorted by some Unicode locale.

Given that set of constraints, I'd say that Cydia is doing a "bang-up job", considering that the slowest step (and certainly the primary one that users complain about on any device less than a couple years old) really and honestly is "downloading that catalog from a distributed and entirely unrelated-to-each-other set of sources ran by random users on the Internet, most of whom have no experience with hosting or operations". ;P
---

You can read some more comments from Saurik and other users in the full thread linked below...

Read More [via chpwn]


Saurik Explains Why Cydia Must Reload Packages at Launch
Add Comment
Would you like to be notified when someone replies or adds a new comment?
Yes (All Threads)
Yes (This Thread Only)
No
iClarified Icon
Notifications
Would you like to be notified when we post a new Apple news article or tutorial?
Yes
No
Comments (13)
You must login or register to add a comment...
Ycydia
Ycydia - September 28, 2012 at 12:41pm
Let's get clear, my previous jailbreak (iOS 5.0.1) was wonderfully loading my package database offline so I can view each package's size, maker... (with more than 5 sources installed!) Now Cydia is not loading anything on startup and displays "Unable to Load" when I'm offline. Saurik, Please tell us a straight answer to this question: What can we do to FIX this?
Benn
Benn - July 19, 2012 at 11:28am
The rhetoric - on both sides - isn't useful (is it ever? Other than when one wishes to speak without actually saying anything, I mean). And the... I guess I'll go with 'creative'... explanations Saurik gave were not entirely truthful - or, rather, he told the truth but not the WHOLE truth. I have added 3 repos to Cydia. When I start Cydia it spends 30-60s refreshing (I assume the variability is due to traffic), then I hit search and before I can type anything it refreshes AGAIN - another 30-60s. Then I type my query, the results arrive at a speed that makes it obvious that nothing is being checked against the refreshed DB, and I select one of the hits - and it refreshes AGAIN. Finally I get to the package page, which takes about a minute to load, and if I choose to click on 'More info' or 'Show Changes' it refreshes AGAIN, and more often than not refreshes yet AGAIN when I go back to the package page. At this point I'm 3-5mins in, before I have enough info to know if I even want to add the package. The frustration of this has made me switch to using iFunbox to install IPA files from apptrackr almost exclusivly. I only use Cydia right when I jailbreak, then I forget about it as much as possible. I've got IPA files and DEB files for everything I use. If it wasn't part of the jailbreak process, I wouldn't use Cydia at all. Everyone has their own inconvenience threshold... Cydia goes waaay beyond mine.
soydepr
soydepr - February 29, 2012 at 8:53am
I want to know why repring is necessary after installing apps
JR72
JR72 - February 28, 2012 at 6:45pm
Absolutely fair enough and perfectly understandable. However, what bugs me is that Cydia never seems to run properly as a multi-tasking app. It seems that every time you have it running, switch back to the home screen or another app and switch back, it does the reloading packages thing again anyway, even it's only about 30secs later. That makes it a bit slow... Anyone know why it has this behaviour?
JR72
JR72 - February 28, 2012 at 6:46pm
PS it did it on my 3GS from ios 3.whatever to 5.0.1 and still does it when everything is as new as it can be on my 4S (UK)
Corey
Corey - February 28, 2012 at 10:46pm
It's my understanding that it does that each time because it runs the Cydia process as root, whereas most other processes are simply run as a standard daemon.
Zahrah
Zahrah - February 29, 2012 at 5:38am
Hi I need sidia
Zahrah
Zahrah - February 29, 2012 at 5:39am
Hi indeed sidia
Mats
Mats - February 28, 2012 at 4:47pm
How about updating Cydget so that I can install CyDialer?? Don't charge for apps unless you are willing to keep them up to date.
budsal
budsal - February 28, 2012 at 11:44pm
DAIMM. NO YOU DIDN'T.
Teh_One
Teh_One - February 28, 2012 at 4:04pm
Moral of the story... Delete the one time repos that you install for getting that "one" tweak....
صلاح الشاوري
صلاح الشاوري - February 28, 2012 at 4:30pm
صلاح الشاوري
JR72
JR72 - February 28, 2012 at 6:42pm
But if you do delete the "one time" repos, then you don't get notified of changes/updates to the package(s) you installed from it...
Recent. Read the latest Apple News.
RECENT
Tutorials. Help is here.
TUTORIALS
Where to Download macOS Monterey
Where to Download macOS Ventura
AppleTV Firmware Download Locations
Where To Download iPad Firmware Files From
Where To Download iPhone Firmware Files From
Deals. Save on Apple devices and accessories.
DEALS