-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cached database on running "Install" command #1645
Comments
Package Control uses 2 levels of caching channel/repository information. A fully evaluated list of packages is hold in RAM for the time specified by After that, channel information are re-fetched from packagecontrol.io preferring locally cached data stored on disk, if 304 is returned by the server. The delay of displaying quick panel is mainly defined by the server response time then - no downloads are taking place. You can increase
It is not planned to perform periodic tasks in the background beyound initial auto-update and package maintanance upon startup. Installing/Updating packages is not a prio 1 task, which happens every 10 minutes during normal work, thus periodically fetching package information is not justified.
Fetching channel data (list of packages) is a crucial part of displaying a list of installable packages and can't be delayed as described. This request just doesn't make sense. |
I'd like to set this to ∞, but then I don't need to waste that memory forever for the rare use of install command, I guess what I'm asking for is to be able to skip the server query stage completely and always use the locally cached data - then I'll get the list without any unneeded delay
that's fine, I don't need it more frequently, updating the local database along with the |
Actually RAM cache isn't actively cleared as doing so doesn't have any effect on plugin_hosts RAM usage (checked on Windows). Thus packag list resides in RAM until next package operation (instantiating of PackageManager) anyway. To check that yourself just call: >>> from package_control import cache
>>> cache.clear_cache() The http cache on the other hand is an implementation detail of the downloader. It has an option to prefer locally cached files without sending a request, but it would a) cause updated channel/repo to be fetched not before After 5 mins, PC would just delete RAM cache to immediatelly rebuild it from the same http download artefact without checking whether it has been updated upstream. That's more or less pointless. |
Just did a quick test:
Don't understand how it squares with your description (at least as how I understand it) that at least within the first 5mins everything should be instant. Maybe it's only caching the default package database? Using the latest beta version https://github.com/wbond/package_control/releases/tag/4.0.0-beta4 |
Available packages are fetched and cached by Faild sources are indeed cached in RAM as well to avoid requerying dead ends. Custom repositories may increase delay of displaying quick panels if cache is cold, especially if they contain unresolved package/release information. Those require at least 2 API calls per package to Github/Bitbutcket/Gitlab to fetch details and tag info, which may take a significant amount of time (see: #1638). That's however nothing PC can improve/solve at this point. What default channel (packagecontrol.io) basically does is to periodically crawl all repositories, do the expensive API calls and stores resolved package information in the channel_v3.json, which PC can download and use directly. |
PC could just skip those calls? Is there a combination of settings that would just not make those calls untill the regular
But it happens even on immediate repeats as mentioned above, tried it again with commenting out custom repositories, and the speed has improved |
If an empty "Install Package" List is good for you, then yes.
I can't reproduce that with default settings, neither with default channel, a custom repository.json or a direct Github repo url in Turning on
There's no indication of any connection being established anywhere, once repositories have been fetched, until the time of Note: Setting That's likely to fail due to rate limits. |
Meanwhile did another test:
so maybe the issue is with beta 4? Though I can't test it since in Normal mode v3 fails with the crypto isssue for which you already have a few issues opened, and I can't manually copy v4 to the safe mode as it gets auto-deleted
:) It won't be empty, I mean repeated calls, not the first one Thanks to your debug command found out that this link (I have
|
And thanks for helping out! |
It appears the reason is an issue with resolving commit timestamps causing a hidden exception while downloading infos from a code hoster. Needs some investigation. |
This commit resolves a type conflicts, which caused exception when parsing release information of packages, hosted on GitHub. As a result packages from Github repositories, using tag based releases were not parsed and thus 1. not published to "Package Control: Install Packages" quick panel. 2. not added to cache, causing them to be re-queried each time the quick panel was triggered (see #1645). Note: Only Package Control client is effected, which tries to reduce amount of API calls, by not downloading commit info of each release tag.
Update: there seems to be 2 things that can be implemented to reduce the needless delay:
Every time I run an
Install Package
command, the Package Control takes some time (I guess to update the database)I'd like to avoid that step and always use the cached version to avoid any annoying delays
Then the update should happen periodically in the background (I don't need to get the latest on every single run)
Or at least it should be delayed until you actually install something
The text was updated successfully, but these errors were encountered: